Galaxy-Defender-Game

๐ŸŽฎ Galaxy Defender Game (C++ OpenGL/GLUT)


๐Ÿงพ Overview

๐Ÿš€ This is a 2D space shooting game made in C++ using OpenGL/GLUT. The player controls a rocket, shoots enemies, and survives as long as possible while increasing score.


โš™๏ธ Game Setup


๐Ÿง  Game Variables


๐Ÿ–ฅ๏ธ Display Function (Rendering Engine)

๐ŸŽฏ This function draws everything on screen every frame:

๐ŸŽฌ Start Screen

๐Ÿ’€ Game Over Screen

๐ŸŒŒ Gameplay Screen


โŒจ๏ธ Controls

๐Ÿš€ Movement

๐Ÿ”ซ Actions


โฑ๏ธ Timer Function (Game Engine)

โšก This is the MOST IMPORTANT part of the game loop.

๐Ÿ”ซ Bullet System

๐Ÿ‘พ Enemy System

๐Ÿ’ฅ Collision Detection

โค๏ธ Life System

๐Ÿš€ Difficulty Increase

๐Ÿ’€ Game Over


๐Ÿ’พ File Handling

๐Ÿ“ Stores player results:

Example:

Name: Saad | Score: 120

๐Ÿ” Game Loop Flow

๐Ÿš€ The game runs continuously like this:

๐Ÿ–ฅ๏ธ Display โ†’ ๐ŸŽฎ Input โ†’ โšก Timer โ†’ ๐Ÿ” Repeat


๐Ÿงฉ Main Function


๐Ÿ“Œ Summary

๐ŸŽฏ Galaxy Defender is a real-time arcade shooter game where: