MainHub Lessons Game Overview
Let’s Go! Let’s Go! Let’s Go!

This is my main overview for the PirateMegaGame. It has examples of what I used for certain topics that align with CS 111 Requirements:

You can reference the code here:

  • We will keep making edits to the code, so the code you see on the files below may not be updated. If you would like to see if we have made any changes to our code, please go to our issues!
Level 1 Level 2 Level 3 Issues/Documentation
View! View! View! View!

And you can play the game here:

☠️🦜 Game Object Class Overview

A clean breakdown of how each object fits into the engine's class hierarchy.

Game Object Class Role
McArchie Player extends Character Player-controlled character
Pirate Pirate extends Character "Enemy" NPC with reaction logic
Map Background extends GameObject Layered scrolling environment
Shields Barrier extends GameObject Collision boundaries

🎓 CS111 Requirements — Interactive Map

Click any section to expand and learn more.

🧬 Object-Oriented Programming

Inheritance `GameObject → Character → Player/Pirate`

Writing Classes Custom subclasses like `Player` and `Pirate`

Method Overriding Custom `update()`, `draw()`, `handleCollision()`

Constructor Chaining `super(data, gameEnv)` ensures engine initialization

🔁 Control Structures

Iteration `forEach` loops in update + cleanup

Conditionals Collision checks, AI decisions, state transitions

Nested Conditions NPC type → proximity → inventory (3 layers)

🔢 Data Types

Numbers `x`, `y`, `velocity`, `score`

Strings Names, sprite paths, game states

Booleans `isPaused`, `isJumping`, `isVulnerable`

Arrays `gameObjects[]`, level arrays

JSON Objects NPC config + GameLevel setup

➗ Operators

Math Ops `+=`, `*`, `Math.pow()`

String Ops Template literals for sprite paths

Boolean Expressions `&&`, `||`, `!`

🎨 Input / Output

Canvas Rendering `draw()` via `requestAnimationFrame`

Keyboard Events `keydown` / `keyup` for movement

GameEnv Config Object literal world configuration

🧪 Software Engineering Practices

Single Responsibility Each method handles one behavior

Data-Driven Design GameBuilder uses Object Literals

Instantiation Level config spawns all objects

Documentation Inline comments everywhere

Testing Objects validated before merge

SDLC Practices Kanban, feature branches, selective PRs