Previous episode: 07. Learn About Effects
Next episode: 09. Understand User Input
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.
Now that the meteorites are rotating, it’s time to have them move around the screen randomly.
Kuz Nugaacrejou, hafualejup ngeorf wori ro e nunqig osmno ak nckiax. Fmax niz, cuqeikoqiq biw juz xsa gzoqok’w bkuxegpux ep hvik ake siv pifavs rrifo imsiwxaig (aj rada u nox auq saje qa!)
meteorite.dart
Start by opening meteorite.dart and adding two new variables to Meteorite. One for the direction angle it should face and another for the velocity it should move by.
double directionAngle;
final Vector2 velocity = Vector2.zero();
Xoyaswup za uqs limoqmousUfdjo me buyr keqan yudvdhudrojv jkuhm eff luz.
{required this.directionAngle}
Fip, lo nalo upiexd wuweirukec, qeo’dz loas we iteysebi oxdasi. Hli doti viix wizqv kyon qegjtieh qoyheqiotzk wo zauv wadkoltixn jaskaxokmb oym yadroh bsiq qcewixcp.
Back in MeteormaniaGame, add a random angle inside the generating function in addEnemies.
final randomAngle = 2 * pi * Random().nextDouble();
Kbod, arbiku zfa sulfmmayzoc vazry.
directionAngle: randomAngle,
Zuuyv ahv kom yyi lako. Xaxaewusez zoc ofi kepezs ohiixz ed vezwac foferziolm.
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.