Object-Oriented Programming Use
Object Oriented Programming
Table of Contents
- Writing Classes
- Methods & Parameters
- Instantiation & Objects
- Inheritance
- Method Overriding
- Constructor Chaining
Writing Classes
We created our custom, unique classes for our red riding game, and extended the classes to include important classes such as Character.js and Player.js
Methods & Parameters
Implemented advanced methods with multiple parameters such as the getCatMullRompoint which calculates a non-linear smooth movement path for the wolf
Instantiation & Objects
Dynamically instantiated multiple Coin objects using a configuration object to define their unique IDs and screen positions
Inheritance
Demonstrated class hierarchy where Wolf class inherits core movement and properties from the Character class
Method Overriding
Overrode parent methods to implement a unique algorithm for our game, such as timing and sizing
Constructor Chaining
Use the super() keyword to call the parent class constructor, ensuring the Wolf object is properly initialized with the game environment settings