Survival Game is a fight game, built for everyone including coders who want a straightforward and efficient way to write and test HTML, CSS, and JavaScript. Using Javascript, I made sure Survival Game is easy to use and gets the job done.
- Move the characters as you want: You can jump, attack, go to the left and to the right.
- Sounds: You can hear sounds when you get hit, when you attack. There is a sound at the end of the game.
CSS
Javascript
HTML
You can play with another person sitting next to you.
- The player (the girl, on the right of the screen) can jump with the ArrowUp Key, go to the left with the ArrowLeft key, go to the right with the ArrowRight key and attack with the ArrowDown key.
- The enemy (on the left of the screen) can jump with the "w" key, go to the left with the "d" key, go to the right with the "a" key, and attack with the space bar.
- The one with the most health after 60 seconds wins, unless one player is defeated before the time runs out.
- Whether it's a win, loss, or a tie, a modal displaying the result appears once the game is over. You will need to refresh the page to start over.
The project could be improved by adding an option for players to replay the game or return to the main menu after a match. Additionally, introducing a third enemy that launches attacks and increasing the frequency of these attacks would enhance the game's complexity and excitement. Finally, the display should be automatically adjusted to fit the screen size for a better user experience.