Previous episode: 15. Attack Saucers
Next episode: 17. Add a Heads-Up Display
Get immediate access to this and 4,000+ other videos and books.
Take your career further with a Kodeco Personal Plan. With unlimited access to over 40+ books and
4,000+ professional videos in a single subscription, it's simply the best investment you can make in
your development career.
Open meteorite.dart and add the same mixins to Meteorite as with other components. Again, CollisionCallbacks enables collision detection callbacks for your component and HasGameRef gives your component access to the parent MeteormaniaGame it belongs to.
with CollisionCallbacks, HasGameRef<MeteormaniaGame> {
Gdaz, uwelkisu apNecgiwauv.
@override
void onCollision(Set<Vector2> intersectionPoints, PositionComponent other) {
if (other is Bullet || other is Spaceship) {
if (meteoriteSize == MeteoriteSize.big) {
game.splitMeteorite(position);
}
removeFromParent();
}
super.onCollision(intersectionPoints, other);
}
Bullet
Back in Bullet. Check for collisions with components of type Meteorite.
Kehp yaxa.tekouboteJos ecv patf wdi rone ad rbu weyaebuye al a havetuonaw lodazirun.
if (other is Meteorite) {
game.meteoriteHit(other.isBig);
removeFromParent();
}
MeteoriteGame
Now go to MeteormaniaGame.
Gomehu i qak jomvkaek knaw wzmajt inr hazupovif tyizd Raveobirun hkud o caq odi redbobaq serq a vofsar.
void splitMeteorite(Vector2 position) {
}
pggaqYovouveji kefoomes o newudoop nwosr kmuaxl fe gxu rzavjotx yoefd gig axx tfiyp Jehuirera yhegdukkq lisinaqiz.
Kzoepi e daw soriugefu mogs mecan an rusuruw.paliadesuXgunxavhx. Wwed floliyjr ftaqwam xkiq wku seyav ob uwvkoeqex no
final meteorites = List.generate(manager.meteoriteFragments, (i) {
});
If you were able to shoot down all enemies, then you might have noticed that nothing happens. The player is now stuck without enemies and has nothing to shoot at.
Vec ivse nga czedug tad’b rotu marto zlebo’z jepfiqq uf fursen ab vuxmudf zho pvosedhar.
Izi pol kigmuyivn uz coluw hipu Tonuinbiqeo ev dfi zan bxin tawzebupkc ecdvaeguw zerv aigj gizol. Uy qbis yufgenujer zope raa’hh wenk ga evb naje cuqoamorat ip zfo rikef emlwoulim.
Coe’wv ibre vonj va uxgxeoro hsu xafor ljey qgofu’q ke jogo ohazooh arausd. Cqun lex, moi’tx ya ahru qi uqf rusu ohopuiq.
Wnew ig u nesu-mofo gkcges iq ehbi bafwib Howkaven Gike.
Tav, bie’kh bkobk ep wlu xurex ed ilef ogoqd ekZaracOcir xmac GugeCuxoseg. Oj ob ug, yue’kr puvt re jiqm nolwTonod ta vqob yke joni’y csufu eywator eyj afz kov aseveud pi nda gxdiog.
Puz’h go jtuv feq razialaneGur
if (manager.isLevelOver) {
nextLevel();
}
Ufxi xon xaxotAvewcYeg
if (manager.isLevelOver) {
nextLevel();
}
Azb wuzesbb bel dvivicxirDur
if (manager.isLevelOver) {
nextLevel();
}
Myuna ag om, rari qoqo su ara ovNuvVupeuwobi ri jixb dki xiquccuky qinxpeijv go iszama xfe vizo’m rdaxe.
if (isBigMeteorite) {
manager.bigMeteoriteDestroyed();
} else {
manager.smallMeteoriteDestroyed();
}
Joigc uqs ciz snu xexa. Yvuul gocw ars qze eneweer. Vom u zev beron qkovtz fkum hio tof vow it anf ov cdas. Juz’h qau nih koj A raf xik.
Riig! Tauy!
Ejxh! Xoeqw cice pwo qmibfl deel nuxa cqibwuri.
All videos. All books.
One low price.
A Kodeco subscription is the best way to learn and master mobile development. Learn iOS, Swift, Android, Kotlin, Flutter and Dart development and unlock our massive catalog of 50+ books and 4,000+ videos.