Skip to content

Samoris/week4_day3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ—ก๏ธ RPG Gladiator Game (JavaScript OOP)

This project is a turn-based RPG game built in vanilla JavaScript using ES6 classes and Object-Oriented Programming (OOP) principles.

Five characters fight in a gladiator-style arena. Each character belongs to a different class with unique stats and special abilities. The game is played turn by turn via a simple HTML interface.


๐ŸŽฏ Project Goals

  • Practice ES6 classes & inheritance
  • Apply OOP concepts (encapsulation, polymorphism)
  • Build a turn-based game system
  • Display game progress in the browser console & UI

๐Ÿ—‚ Project Structure

rpg-gladiator-game/
โ”‚
โ”œโ”€โ”€ index.html      # Main HTML interface
โ”œโ”€โ”€ index.js         # Game logic (characters, classes, turns)
โ””โ”€โ”€ README.md       # Project documentation

โš”๏ธ Characters & Classes

Each character has:

  • HP (health points)
  • DMG (damage)
  • Mana
  • Status (playing, loser, winner)

If a characterโ€™s HP reaches 0, they are eliminated.
When a character kills another, they gain 20 mana.


๐Ÿง™โ€โ™‚๏ธ Available Classes

Class HP DMG Mana Special Ability
Fighter 12 4 40 Dark Vision (damage + shield)
Paladin 16 3 160 Healing Lighting
Monk 8 2 200 Heal
Berzerker 8 4 0 Rage (permanent dmg boost)
Assassin 6 6 20 Shadow Hit

๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘ Characters in Game

  • Grace โ†’ Fighter
  • Ulder โ†’ Paladin
  • Moana โ†’ Monk
  • Draven โ†’ Berzerker
  • Carl โ†’ Assassin

๐ŸŽฎ Game Rules

  • The game lasts up to 10 turns
  • Each turn:
    • Characters play in a random order
    • Each character attacks or uses a special ability
  • The game ends when:
    • Only one character is alive, or
    • 10 turns have passed
  • The character with the highest remaining HP wins

๐Ÿ–ฅ Interface & Controls

The game runs in the browser using a simple UI.

Buttons

  • Start Game โ€“ Initializes the game
  • Next Turn โ€“ Plays exactly one turn
  • Watch Stats โ€“ Displays all charactersโ€™ stats

All actions and events are logged in:

  • The browser console
  • The on-page log panel

โ–ถ๏ธ How to Run the Game

  1. Download or clone the project
  2. Open index.html in a web browser
  3. Click Start Game
  4. Click Next Turn to advance the game turn by turn

No installation or dependencies required.


๐Ÿง  Technical Notes

  • Uses ES6 classes and inheritance
  • No blocking while loops for turns
  • Turn-based logic handled via user interaction
  • Easily extendable (items, UI, player input, etc.)

๐Ÿš€ Possible Improvements

  • Manual target selection
  • Health bars & animations
  • Automatic turns with timers
  • Inventory & items
  • Save / reset functionality

๐Ÿ“œ License

This project is for educational purposes only.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published