As part of my Object-Oriented Programming (OOP) class at Mahasarakham University, I had the opportunity to work on an exciting project called Galaxy Wars. This space-themed shooting game not only allowed me to apply various OOP concepts but also resulted in an engaging and fun gameplay experience.
In Galaxy Wars, players take on the role of a planet’s defender, tasked with protecting it from a barrage of incoming meteors. The main objectives are:
Throughout the development of Galaxy Wars, we implemented several key OOP concepts:
Entity
base class for game objects like Player
, Meteor
, and Item
.GamePlay
encapsulate game logic and state.update()
and draw()
methods are implemented differently for various game entities.ItemType
interface for different types of power-ups.Difficulty
enum represents different game difficulty levels.The project is organized into several packages:
game
: Contains the main game logic and componentsgame.controller
: Handles user inputgame.entity
: Defines game objects (Player, Meteor, Item, etc.)game.gui
: Manages game UI componentsgame.interfaces
: Defines interfaces used in the gamegame.util
: Provides utility classes for file management, image handling, and soundWant to experience Galaxy Wars for yourself? You can download the game using the link below:
To play:
java --enable-preview -jar .\GalaxyWars.jar
file to start the gameEnjoy defending your planet from the meteor onslaught!
Working on Galaxy Wars was an incredible learning experience. Our team of five collaborated on various aspects of the game:
We faced challenges in implementing smooth gameplay mechanics, balancing difficulty levels, and creating engaging visual and audio elements. Through teamwork and applying OOP principles, we overcame these obstacles and created a game we’re proud of.
Galaxy Wars showcases the power of Object-Oriented Programming in game development. It demonstrates how concepts like inheritance, encapsulation, and polymorphism can be applied to create a functional and enjoyable game. This project not only enhanced our programming skills but also gave us valuable experience in teamwork and project management.
We hope you enjoy playing Galaxy Wars as much as we enjoyed creating it. Don’t forget to download the game and test your skills as a planetary defender!