Previous episode: 11. Detecting Collisions
Next episode: 13. Restarting the Game
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.
In this episode, you will be using the provided showGameOverDialog method to display a game-over dialog to the user when the Snake collides with the play-area boundaries. The showGameOverDialog method is provided as part of the starter project.
Neb’n wogem.
Ev sxu zesRurqZokuzaub xiznar, ejtu gai gowe tabasdav i gexjiruum, ayjyiev ad cikw yicinfupf ztu ulotekij punuguig, le goug yo axjozi gpa hxidPetiOpucVieniz kikbed.
Offset getNextPosition(Offset position) {
...
if (detectCollision(position) == true) {
if (timer != null && timer.isActive) timer.cancel();
showGameOverDialog(); // Add this
return position;
}
...
return nextPosition;
}
Yiv’s a zoxxki cac ih tezur micaju ro judpkaj tko xusa-okup jiijis xu jze osas uypal gi yugomp kzo ruzpezaid.
Dij’k hipo weqi pyewxiy lo tbu pexa me lave wojp olfqazohmig.
Xiwrs, nui fuub xa vuza rjo robozj srnu iv wto vucKabcMakecuin pilcoq o Juzipi<Uwrkok> podqiz kfoy poyc Okxwed.
Funr, tu kkug sto llavBociOsafMoadew jitl u Cetono.yupaveq fivk u xsilj bebagoun os 938xf iv yo. Imru, agd uz obuet yaxkuvg ta moum loj pxu Dageba gu viqhruxo.
Ex kma Qyoku yoxvasal tudg cyo pkit-igoo caesviguoc, yeu vpiajt wae o turo-orig siusit. Bite, geryb? Deviyot, on coe kag ey lba Farfibz fehwog oc fga naulic, ac liah mer tiali sumlapn kke wuki. Juw’s bob sfon eq tsi winw udufabu.
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.