Sprint 6 Final Project Skills - Object-Oriented Programming & Inheritance
Object-Oriented Programming (Classes, Methods, Instantiation, Inheritance, Overriding, Constructor Chaining)
Table of Contents
1. Object-Oriented Programming
Our game architecture heavily utilizes OOP to structure characters, platforms, and game levels. Each required OOP skill is distinctly implemented below via its own code block.
Writing Classes
We create custom character classes extending base classes.
Code Runner Challenge
Demonstrating Writing Classes.
Methods & Parameters
We implement methods that take external parameters (like collisionHandler(other, direction)).
Code Runner Challenge
Demonstrating Methods & Parameters.
Instantiation & Objects
We instantiate game objects using configurations.
Code Runner Challenge
Demonstrating Instantiation & Objects.
Inheritance (Basic)
We create a class hierarchy with multiple levels (e.g., GameObject -> Character).
Code Runner Challenge
Demonstrating Inheritance.
Method Overriding
We override parent methods (like update() and draw()).
Code Runner Challenge
Demonstrating Method Overriding.
Constructor Chaining
We use super() to chain constructors from the parent class.
Code Runner Challenge
Demonstrating Constructor Chaining with super().