Skip to content

Air Battle is a classic 2D shoot 'em up game built with C++ and SDL 2.0. Players control a fighter plane to destroy enemies and defeat the final boss. Features include pause, restart, sound effects, background music, random power-ups, and multiple background levels.

License

Notifications You must be signed in to change notification settings

HuyDang05/Air_Battle

Repository files navigation

AIR BATTLE

TABLE OF CONTENTS

INTRODUCTION

  • Full name: Dang Quang Huy - K68J - UET
  • Student ID: 23020671
  • Project: AIR BATTLE (INT2215_52 - Advanced Programming)

SETUP:

LINK YOUTUBE :

https://youtu.be/21B0FujcbVE

DISCRIPTION

GAME DISCRIPTION AND INSTRUCTION :

  • AIR BATTLE is a shoot 'em up (Shmup) game where the player controls a fighter aircraft to destroy all enemy planes and the final boss.
    In addition to the main objective, the game also includes optional challenges based on time and score, adding more intensity and excitement.
    Random support items will occasionally appear on the screen — collecting enough of them grants the player an extra life.
  • In each session, the game randomly selects a background to create variety and enhance the player’s experience.
  • The game features all essential functions: pause/resume using the ESC key, restart the game, view gameplay instructions, and exit the game with ease.
  • Background music plays continuously throughout the game, along with engaging sound effects for shooting and explosions, adding to the excitement and immersion.
  • AIR BATTLE promises to deliver an enjoyable and dynamic gaming experience with its exciting features and vivid graphics.

CONTROL

KEYS FUNCTION
W UP
S DOWN
A LEFT
D RIGHT
K LASER BULLET
L DART BULLET

PREVIEW :

MENU START :

a1

GUIDE :

a2

FIGHT WITH BOSS :

a6

DEFEAT :

a4

VICTORY :

a5

GRAPHIC :

BULLET

dartbl laserbl bl4 bl8

MAIN :

c3

THREATS :

c2

BOSS :

c4

EXPLOSION :

expmain

SUPPORT ITEM :

gold

LIFE :

health

SEE ALSO

Technologies and Techniques Used:

  • Utilized the SDL 2.0 library, programmed in C++, and developed using Visual Studio Code.
  • Applied Object-Oriented Programming (OOP) principles, with separation between .cpp and .h files for better code organization and maintainability.
  • Created a variety of game objects: the main character, enemy planes, boss enemy, power-up items, bullets, text elements, and the main character's HP bar.
  • Applied mathematical concepts to handle collision detection between objects: bullets and enemies, the main character and support items, etc.
  • Handled timing, scoring, mouse and keyboard interactions, audio playback, rendering of images and text, and random background selection on game start.
  • Implemented a menu system to enhance game realism: start menu, instruction/help menu, victory menu, and game over menu.
  • Developed logic for enemy shooting and horizontal movement; when an enemy is defeated, it respawns at a random position on the screen.
  • Designed the Boss object as a subclass of the enemy (threat) object, with extended features: higher HP, different and faster movement, more rapid shooting, etc.
  • Utilized class inheritance from a base class to organize and extend game object behaviors.

References:

  • Installing SDL 2.0 in Visual Studio Code: Referenced guides and discussions on Reddit, Stack Overflow, and Lazy Foo’.
  • Using the SDL 2.0 library and managing the program structure: Referenced tutorials from Lazy Foo’, videos by Ms. Trần Thị Minh Châu, Stack Overflow, and YouTube channels such as Let's Make Games, Madsycode, and Phát Triển Phần Mềm 123 A-Z.
  • Images: Sourced from Google and some simple assets were self-designed.
  • Audio: Found via Google search and websites like pixabay.com.
  • Core game logic: Based on YouTube tutorials from Phát Triển Phần Mềm 123 A-Z, with further custom development for features like support items, boss objects, menu system, and additional gameplay conditions involving time and score.

CONCLUSION

  • Significantly improved logical thinking, collision handling, and coding skills.
  • Enhanced creativity, idea development, and skills in editing images and audio.
  • Gained experience in setting up the development environment and working with external libraries.
  • The program is structured in a way that makes it easy to refactor and add new features.
  • Learned how to organize and structure code blocks for smooth and efficient performance, as well as how to write clean, optimized, and maintainable code, especially when handling core game logic.
  • Acquired deeper understanding of the SDL2 library, including functions for handling graphics, audio, and text.

Future Improvements:

  • Add a leaderboard feature, allowing players to enter their name and save their score after each game session.
  • Introduce more types of power-up items with different effects.
  • Add obstacles and bombs to increase the challenge and gameplay variety.
  • Implement a difficulty selection menu, enabling players to choose enemy speed and quantity based on their skill level.
  • Add a two-player mode, allowing two players to play together or compete against AI.

About

Air Battle is a classic 2D shoot 'em up game built with C++ and SDL 2.0. Players control a fighter plane to destroy enemies and defeat the final boss. Features include pause, restart, sound effects, background music, random power-ups, and multiple background levels.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published