214k views
1 vote
Of the three sprites that you created for your space invaders game in the unit, which sprite (or sprites) should be able to do the following: appear at the ship when the space bar is pressed, move straight up when fired, disappear if off the top of the screen, and disappear if it hits an enemy object?

1) the enemy object
2) the laser
3) the ship
4) the laser and the ship

User Maxtuzz
by
7.6k points

1 Answer

4 votes

Final answer:

The sprite with the described behaviors appearing at the ship when fired, moving up when fired, and disappearing upon hitting the top or enemies is the laser.

Step-by-step explanation:

The sprite that should be able to appear at the ship when the space bar is pressed, move straight up when fired, disappear if off the top of the screen, and disappear if it hits an enemy object is the laser. This is because in a Space Invaders game, the laser is typically the projectile that the player's ship fires at the enemy objects. In game design, we assign different behaviors to different sprites, and the described behaviors are characteristic of a projectile, not of the player's ship or the enemy objects. The ship is the player-controlled sprite that launches the laser, but it does not itself move straight up or disappear upon hitting an enemy. Similarly, enemy objects are there to be hit by the laser; they do not fire themselves.

User StuartQ
by
7.6k points