Press the Stop/Play button to apply your changes to the code.
player = object_new('obj_player')
Now press Stop/Play again and check out your new spaceship!
sprite = sprite_new('spr_player')
Press Stop/Play and see what happens!
player.x = 100
Now it should move to the left. Again, see if you can make your spaceship touch the left edge of the screen without going too far.
player.x = -100
See how it moves up? Try changing the number until you reach the top edge of the screen. And finally, just like before, change it to a negative number and try to touch the bottom edge of the screen.
player.y = 100
Just like before it’s only a blue block that says "empty image". Remember how we fixed that last time? We added a sprite onto the object!
asteroid = object_new('obj_asteroid')
sprite = sprite_new('spr_asteroid')
Change the numbers around to whatever you want to put it somewhere in the game.
asteroid.x = 100 asteroid.y = 100
Ready for more? Try the next lesson!
PixelPAD is loading...