In this project, we'll continue building our Alien Intruders game by animating our ship using a sprite.
The hardware setup for this project should be the same setup that was
completed for the project. Here's a reminder:
We should now have a working Alien Intruders game, but we can make it more visually appealing by custom designing our ship using the Sprite functionality in the API that we learned about earlier.
To change the ship to a custom sprite, we need to include some basic initialization code, code to design the sprite configuration and code to draw the sprite.
Here is what the code for this project should look like at this point (with new changes highlighted with arrows) — when you run the code, you should now see our spaceship dot replaced with a nicer spaceship design:
Create your own Sprite
that is five points wide and more than 2 points tall.
If you created your own wider Sprite
, you'll notice that the
missile will no longer shoot from the middle of the ship. Modify the code
to have it shoot from the middle.
With a taller ship, you may notice that the missiles still shoot starting
from the bottom row of the display. Change this so that missiles shoot
starting from the top of the Sprite
.
With a taller ship, aliens will continue marching down even when they've
already touched the top of the ship. Modify the code so that the game ends
right when the aliens get to the row that contains the top of the ship
Sprite
.