KIERAN  ☆ ☆ ☆'s profile picture

Published by

published
updated

Category: Games

Asteroids Prototype: DEV LOG 2

4/04/25 a ton of progress!

Hey! I've made a lot of progress since the last blog post so that's what I'll be talking about. First, I remember from my previous dev log that I was going to add the asteroids mechanics. I wanted to make it so when the scene started, different sizes of asteroids will randomly spawn in and will fling around in random directions. To achieve this I first created the sprites of the asteroids and added object timers to the start of the scene like this:

this is so i can later use this and connect it to the actual mechanics of the asteroids:

Essentially what this code is saying is that every (x) amount of seconds a different sized asteroid will spawn in and will be assigned a random force and direction it will move at that force. It will change animation randomly as well. so after that, this is what my game looked like:

As you can see from this gameplay, only the large asteroids are spawning. Unfortunately, at the time I had made an error here and was meant to use scene timers instead of object timers in order for the medium and small asteroids to spawn. 

Now I just needed these asteroids to interact with the player. Firstly, i gave the bullet sprite the ability to destroy (delete) the asteroids when in collision:

It also plays a sound after the asteroid is destroyed. I then had to give the player the ability to get damaged and die in the game. I achieved this by using the "Health" extension and attached the health behavior to the player sprite. Then, I made it so that when an asteroid collides with the player, the player will lose:

The scene will then switch to the game over screen. So now the gameplay looks like this: 

that's all for today, next ill be allowing people to playtest in order to refine my game :3. Kieran signing outt.


0 Kudos

Comments

Comments disabled.