This project is an immersion into the fundamentals of Object-Oriented Programming (OOP). Featuring an RPG theme (inspired by classics like Baldur's Gate), the code manages different hero classes, each with unique properties and combat methods.
The primary goal was to move beyond linear programming to create a system where data and behaviors (methods) are encapsulated within Classes.
- JavaScript (ES6+): Implementation of modern Classes and iteration methods.
- Node.js: Script execution environment.
In this challenge, I demonstrated proficiency in:
- Classes and Constructors: Creating blueprints for complex objects using the
constructormethod. - Class Methods: Implementing the
attack()method to encapsulate hero behaviors. - Array Iteration (forEach): Handling arrays of objects (
heroDescription) to automatically instantiate and execute methods. - Dynamic Instantiation: Utilizing the
newoperator to create unique objects from a base class.
The system dynamically processes heroes such as:
- Laurel: Elf Paladin.
- Astarion: Vampire Spawn Rogue.
- Gale: Human Wizard.
- Clone this repository:
git clone [https://github.com/xtheredviper/hero-adventure-classes.git](https://github.com/xtheredviper/hero-adventure-classes.git)