90. Space Force

Write a program similar to the one shown in the following screenshot:

Pressing the up arrow key should accelerate the spaceship. Pressing the left and right arrow keys should turn the ship to the left or right. Pressing the spacebar should play a sound effect and make the ship fire a bullet. Require the guns to spend at least a quarter second between shots reloading.

When the user starts a new game, create bubbles with different sizes and colors moving in random directions. If a bubble leaves one side of the form, make it reappear on the opposite side.

If a bullet hits a bubble, pop the bubble and play a sound effect. If a bubble hits the ship, replace the ship with an explosion, again playing a sound effect. Finally, if the user pops all of the bubbles, play a celebratory sound effect.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset