This tells the code that this particular script does in fact need to use all of the functions that create random effects.
if asteroidTimer == 120: asteroidOffset = random.randint(-200, 200) asteroid = object_new('obj_asteroid') asteroid.x = self.x + asteroidOffset asteroid.y = self.y + asteroidOffset asteroidTimer = 0
If an asteroid ever gets so low that their y position is -400, they are long beyond our reach, so let’s just get rid of them!
if self.y ‹ -400: destroy(self)
Again, if our projectile goes as high up as 600, it has missed any asteroids it might have been able to hit, so let’s free up that computer memory for more important things!
if self.y > 600: destroy(self)
Now if you press reload, hopefully everything will be the same as before. The only difference is that now we have the ability to change levels later on! We can eventually make rm_level2, rm_level3 and so on forever!
Ready for more? Try the next lesson!