Welcome to Battleground, an exciting fighting game built using JavaScript, HTML, and CSS. In this game, you'll control two powerful warriors who will engage in epic battles until one emerges as the ultimate champion!
The game screen consists of two fighters facing each other, each represented by an animated character. The player on the left side is Player 1, and the one on the right is Player 2.
-
Player 1 Controls:
- Q: Attack - Press the Q key to make Player 1 strike Player 2. Each attack inflicts random damage between 1 and the player's attack power (shown as AttackDmg).
- A: Heal - Press the A key to make Player 1 heal. Healing restores a random amount of health between 1 and 5.
-
Player 2 Controls:
- P: Attack - Press the P key to make Player 2 strike Player 1. Similar to Player 1, each attack deals random damage between 1 and the player's attack power (AttackDmg).
- L: Heal - Press the L key to make Player 2 heal. Healing restores a random amount of health between 1 and 5.
-
Simulate Button: Click the Simulate button to let the AI control both players and watch them fight automatically.
-
Reset Button: After a match is over, click the Reset button to start a new battle with both players' health restored to 100.
The game continues until one of the players' health drops to 0 or below. The first player to reach 0 health loses, and the other player is declared the winner.
The game features sound effects for attacking and healing actions, adding to the immersive experience.
Enjoy the thrilling battles in Battleground! Challenge your friends and see who can emerge as the true fighting champion. Feel free to customize the game further, add more characters, or enhance the gameplay as you wish.
To run the game locally, follow these steps:
-
Clone this repository to your local machine or download the project files as a ZIP archive.
-
Open the
index.html
file in your web browser. -
Start playing the game using the player controls described above.
If you want to customize the game or add new features, you can modify the JavaScript code (script.js
) and CSS code (style.css
). Experiment with different characters, attacks, and sound effects to make the game your own.
- The animated character images are taken from Giphy:
- Player 1: Giphy Link
- Player 2: Giphy Link
- Sound effects are sourced from SoundBible under Creative Commons License:
- Fast Punch Sound: Sound Link
- Fast Heal Sound: Sound Link
- Quick Hit Sound: Sound Link
- Quick Heal Sound: Sound Link
- Victory Sound: Sound Link
This project is licensed under the MIT License.
Thank you for playing Battleground! If you have any questions or feedback, feel free to contact us. Have a great time battling it out!