This is a programming university assignment that aims to develop a game similar to Space Invaders.
Table of Contents
This is a programming college assignment that aims to develop a game similar to Space Invaders. That was my first big project and it took me and my college fellows three months to finish it. We had to work hard to get it working before the deadline. At the time we started it I didn't have much programming experience, thus besides helping my friends build the game I had to learn the C language. We used a library called Allegro 5 that helped us a lot in the process, you can check its documentation on this link.
All the magic behind this game relies on moving images on the screen at very specific moments. Any point on the game screen has an X and Y coordinates that locate it. For instance, the player ship image is located at a specific part of the screen when the game starts, if one press the right arrow (->) of the keyboard it is going to added 10 units to the ship image X coordinate moving it to the right. The thing is, the program checks if the location of any image on the screen needs to change because some event just happened then it redraws all images on the screen at their current location. That happens 60 times per second, that's why our game (a program that redraws images on the screen very quickly) seems to be very fluid. Examples of events can be the act of pressing a key (space bar, for example), or just time passing.
Now, let's see how you can get a local copy of this game and run it.
Obs: the final version of this game is only available for windows. But, one could transform all the code into an executable to run on linux or other operating systems.
- Clone the repo:
git clone https://github.com/VitorgsRuffo/Galaxy-Defenders.git
- Go to the repo's exe directory and extract the "Galaxy_Defenders_exe.rar" file:
cd /path/to/repo/Galaxy-Defenders/exe unrar e Galaxy_Defenders_exe.rar
-
Double click the GalaxyDefenders.exe file and enjoy the game!
-
You can check out some nice game screenshots.
Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature'
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GPL-3.0 License. See LICENSE
for more information.
Olavo Nascimento - [email protected]
Vitor G. S. Ruffo - LinkedIn - [email protected]