This first level is going to be an easy level for the player. We are going to arrange our sprites into the scene. This is only our first level, so we will only include two asteroids in this level, adding more in later levels as the game goes on.
In the previous screenshot, you can see the level put together with two asteroids. After I did this, I duplicated the Big Asteroid actor in the Inspector, renamed it Small Asteroid and sized it down by half. So instead of 50 x 50 px, the Small Asteroid is 25 x 25 px. I created these Small Asteroid actors because when you shoot the Big Asteroids they will spawn three smaller asteroids like the original game. Cool huh?
100
and Height to 20
. Score
. game.Score
, and then click the green arrow to accept the changes. Change the size to 15
, and keep the color white. 0
. random(-50,50)
, so this will make the asteroids rotate at different speeds. The negative number will make it rotate counter-clockwise and the positive number will make it rotate clockwise. random(0,360)
, then change the Speed to random(5,50)
. This will make the asteroid move in a random direction from 0 to 360 degrees, and then the speed will make it move slow or fast.What did we do? Just to recap, we added custom behaviors to randomize the movement of these asteroids; we varied the rotation, the speed, and the direction they move in with simple behaviors.
18.226.185.196