Invader Game / Scene Scroller
TThis project combines both the invader game and the scene scroller project into one game. First the game is rearranged, placing the launcher on the left side of the screen moving vertically, and the invaders on the right side of the screen moving horizontally. A score board is located at the bottom, keeping track of the score and the number of lives remaining. Also, sound effects are included using the sound object to control when each sound is played. Finally, fireball animations where added to the aliens to simulate explosions when they are destroyed.
Invader Game
The movement of the launcher was modified to simulate acceleration in its movements. These scripts make the ship appear to ease into its movements, making the launcher's movements less mechanical. Basically, the yaccel variable is added to the ymov variable for each frame that an up or down arrow is pressed. If ymov reaches the ylimit, then the acceleration stops and the launcher moves at constant rate. It was also necessary to add de-acceleration when the user is no longer pressing an arrow key. These scripts make the ship appear to ease into its movements.
The firing mechanism of the launcher was modified to allow the user to fire only one bullet at a time, making the game more challenging. To accomplish this, the Key.isDown handler is only called if the bulletNo variable is false. When a bullet is fired, the bulletNo variable is changes to true, which disables the firing mechanism. When the bullet hits an invader or moves off of the screen, then the bulletNo variable is reset to false, allowing the user to fire once again.