This project is a simple 2D game developed using the LÖVE 2D framework. The game features basic gameplay mechanics where players control a character, shoot bullets at enemies, and manage health points to survive as long as possible.
-
Game Structure:
- Object-oriented design with classes for entities like Player, Enemy, Bullet.
- State Machine manages different states of the game (Main Menu, Hero Selection, Gameplay, Game Result).
-
Entities:
Player
: Controlled by the user; can move left and right, shoot bullets, and has health points.Enemy
: Non-player characters that move towards the player and have their own health points.Bullet
: Projectiles fired by the player to hit enemies.
-
Gameplay Mechanics:
- Players can select a hero before starting the game (Pudge or Viper).
- The player moves left and right using arrow keys and shoots bullets with the space key.
- Bullets decrease an enemy's health when they collide, and enemies increase their speed as they take damage.
-
State Machine:
- Manages transitions between different states like Main Menu, Hero Selection, Gameplay, and Game Result.
- Handles input events and updates the game state accordingly.
-
Sound & Music:
- Background music and sound effects are played for various actions like shooting, impacts, etc.
-
Game Configuration:
- Configuration data for heroes and general game settings are stored in separate modules.
-
Game Result:
- Displays the result of the match based on health scores of player and enemy entities.
- Announces whether the player or enemy wins and shows their respective health points.
main.lua
: The entry point of the game, initializing the state machine and background.background/background.lua
: Manages the background elements like stars and comets.game/*
: Contains modules for entities (Player, Enemy, Bullet) and game configuration.stateMachine/*
: Modules for managing different states of the game and handling transitions.music.lua
: Handles loading and playing sound effects.
To run this project, you need to have the LÖVE 2D framework installed on your system. You can download it from love2d.org.
- Clone or download this repository.
- Place the game files in a folder.
- Drag and drop the folder onto the LÖVE executable, or use the command line to run
love <path-to-game-folder>
.
- Arrow keys: Move left and right
- Space key: Shoot bullets
This project is licensed under the License. See the LICENSE file for details.