Skip to content

This is a small game project created for fun as I test and explore my game development skills. It's a simple prototype made with Pygame, featuring basic game mechanics. The goal is to build something interactive while learning more about game development concepts. Feel free to explore the code, make improvements, or contribute if you'd like. 😊😜

Notifications You must be signed in to change notification settings

Tritonix711/The-Space-War

Repository files navigation

Screenshot 2024-12-16 221340 Screenshot 2024-12-16 221228

The Space War

Welcome to The Space War, an exciting and fast-paced game where you control a spaceship to defeat enemy ships and avoid their bullets. Created using Pygame, this game features vibrant graphics, smooth controls, and thrilling gameplay.


Why I Created This Game

I created The Space War as a fun project to experiment with game development. Although my main focus is AI development, I wanted to try something new and explore the world of game creation. This project was a way to challenge myself by combining skills in game mechanics, animation, and user interaction. It was a refreshing break from AI development, allowing me to learn and experiment in a new domain!


How to Play

  • Player Ship Controls:

    • Use the arrow keys or A/D keys (left/right) to move the ship.
    • Alternatively, move the ship with your mouse by pointing to the desired location.
    • Press Spacebar or click the left mouse button to shoot.
  • Objective:

    • Destroy enemy ships while avoiding their bullets.
    • Score points for each enemy ship destroyed.
    • The game ends when you get hit by an enemy bullet.

Features

  • Player Ship: A moveable ship controlled by either keyboard or mouse.
  • Enemies: Enemy ships spawn at random positions and move downwards.
  • Bullets: Both the player and enemy ships shoot bullets.
  • Explosions: Visual effects show explosions when an enemy is destroyed or when the player gets hit.
  • Score System: Track your score as you destroy enemy ships.

Libraries & Tools Used

  • Pygame: The primary library used to develop the game, handling graphics, events, and sound.
  • Python: The programming language used for its simplicity and flexibility.
  • Pygame.mixer: Manages game sounds and audio effects, such as shooting and explosions.

Game Assets

The game uses custom images and sounds stored locally. To ensure proper operation, make sure all the following assets are in the specified directories:

Image Assets:

  • Background Image: The background for the game screen.
  • Player Ship Image: Represents the player's spaceship.
  • Enemy Ship Image: Represents the enemy ships.
  • Bullet Images: Represents the player’s and enemy’s bullets.
  • Explosion Image: Used for explosion animations.
  • Game Over Image: Displayed when the game ends.

Sound Assets:

  • Laser Sound: Played when the player fires a bullet.
  • Explosion Sound: Played when an enemy is destroyed or the player is hit.

Installation Instructions

Prerequisites:

Ensure you have Python 3 and Pygame installed. You can install Pygame with the following command:

pip install pygame

Clone the Repository:

Clone the repository to your local machine:

git clone https://github.com/Sd338/The-Space-War.git

Asset Files:

Make sure to place all the necessary image and sound asset files in the correct directories as indicated in the code.

How to Run the Game

  1. After setting up the assets and dependencies, open a terminal/command prompt.
  2. Navigate to the project directory.
  3. Run the game using the following command:
python main.py

The game window will appear, and you can start playing right away.

Troubleshooting

  • If you encounter errors related to missing assets, double-check that the image and sound file paths are correct.
  • If the game is lagging, try reducing the number of enemies or adjusting the resolution.

Contributing

If you'd like to contribute to this project, feel free to fork the repository, make changes, and submit a pull request. Your contributions are always welcome!

License

This is an open-source project. You are free to use, modify, and distribute it, but please credit the original author.

About

This is a small game project created for fun as I test and explore my game development skills. It's a simple prototype made with Pygame, featuring basic game mechanics. The goal is to build something interactive while learning more about game development concepts. Feel free to explore the code, make improvements, or contribute if you'd like. 😊😜

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages