Raumschiff-Game is a simple 2D spaceship game where the player controls a rocket to avoid or destroy UFOs while dodging obstacles and maintaining a high score. The game offers two difficulty modes: easy and hard. The goal is to survive as long as possible without hitting walls or UFOs.
- Difficulty Levels: Choose between easy or hard modes.
- Collision Detection: Detect collisions with UFOs or walls.
- Score System: Keep track of your score based on how long you survive and how many UFOs you destroy.
- Rocket Health: The rocket has 3 hearts (lives), and collisions will reduce health.
- Auto-recovery: After a collision, the rocket is temporarily invulnerable.
-
Start the Game:
- Open the game in a browser.
- Select the difficulty level: "Easy" or "Hard" by clicking the respective button.
-
Controls:
- Arrow Up (↑): Move the rocket up.
- Arrow Down (↓): Move the rocket down.
- Space: Shoot (not implemented in this version).
-
Objective:
- Avoid colliding with UFOs and the walls.
- Your rocket has 3 lives. When all lives are lost, the game will end, and your score will be displayed.
- The score increases as you survive longer and destroy UFOs.
-
Game Over:
- After losing all lives, the game will display the final score and automatically reload after 5 seconds.
- A modern web browser that supports HTML5 and JavaScript.
- Download the assets required for the game (images for the rocket, UFO, hearts, etc.).
-
Clone the repository:
git clone <repository-url>
-
Ensure the necessary assets (e.g.,
rakete.png,ufo.png,herz.png,hintergrund.png,Explosion.png,schild.png) are in the same directory as the HTML and JavaScript files. -
Open the
index.htmlfile in your preferred browser to start playing the game.
index.html: The main HTML file that sets up the structure of the game, including buttons, canvas, and score display.space_game.js: The JavaScript file that contains the game logic, including movement, collision detection, score tracking, and rendering.- Assets (Images): Make sure the following images are included in the same directory:
rakete.png: The rocket image.herz.png: The heart (life) icon.ufo.png: The UFO enemy.hintergrund.png: The game background image.Explosion.png: The explosion effect.schild.png: The shield icon for recovery after collision.
- Movement: The rocket moves up and down based on the arrow keys. UFOs move from right to left.
- Collisions: Collisions with UFOs or walls will damage the rocket. After 3 collisions, the game ends.
- Score: The score increases with time and for each UFO destroyed.
- Recovery Mode: After a collision, the rocket enters a brief recovery period where it is invincible and changes appearance.