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.

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...

Methods & Parameters

We implement methods that take external parameters (like collisionHandler(other, direction)).

Code Runner Challenge

Demonstrating Methods & Parameters.

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...

Instantiation & Objects

We instantiate game objects using configurations.

Code Runner Challenge

Demonstrating Instantiation & Objects.

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...

Inheritance (Basic)

We create a class hierarchy with multiple levels (e.g., GameObject -> Character).

Code Runner Challenge

Demonstrating Inheritance.

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...

Method Overriding

We override parent methods (like update() and draw()).

Code Runner Challenge

Demonstrating Method Overriding.

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...

Constructor Chaining

We use super() to chain constructors from the parent class.

Code Runner Challenge

Demonstrating Constructor Chaining with super().

Lines: 1 Characters: 0
Output
Click "Run" in code control panel to see output ...