/star-wars-python

Star wars is the classic spaceship destroyer game made with python, using Object Oriented Programming.

Primary LanguagePython

Star Wars✨

Star wars is the classic spaceship destroyer game made with python, using Object Oriented Programming.

Module Used🧩

This project is based primarily based on the pygame module for setting all the parameter, windows, images, events, etc. To facilitate this, additional modules inclue sys, time, math and random

OOP concepts⚡

There are two classes- namely Enemy and Player that have different methods which handle handle different in-game mechanisms of the movement of players and enemies, while also checking the boundary conditions of the screen, loading of images, firing of bullets, collision of bullets with enemy as well as inter-collision of enemies themselves. Moreover, concepts such as encapsulation, abstraction and modularization have also been used to make the code easier to maintain and faciliate readibilty.

Components🔢

This project contains a folder named 'images' which contains all the relevant media files and a .py file named Star_Wars.py. Moreover, there is a requirements.txt file and git attributes files.

Instructions to play🎮

  1. Use the left and right arrow keys to move the player and the space bar key to fire bullets.
  2. Each enemy takes 3 bullets to kill.
  3. Each correct hit on an enemy gives 10 points and killing an enemy gives an additional 10 points.
  4. For every 100 points a player scores, they are promoted to the next level and the number of enemies increases at every level, until reaching the maximum of 5 enemies.
  5. A player has 3 lives.
  6. If an enemy reaches the end of the screen without being killed, the player loses a life.

Outcomes of this project✔

  • With the help of this project, one can understand key features of python game development with the pygame module. Using methods to load background images, handle event loops, take care of exceptions and cause sufficient delay, the usage and extent of pygame is thoroughly explored.
  • Secondly, the use of Object Oriented Programming in the project helps one develop the key concepts required for handling objects, using instaces, using dunder methods, etc.
  • Lastly, one can learn the multi-file project framework of python by importing media files and modifying them.

Future updates✈

Future updates may include a voice recognition based control system, under development!