Pirate Game Overview
Pirate Game Overview - CS111 Review
| 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:
| 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.
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
Iteration `forEach` loops in update + cleanup
Conditionals Collision checks, AI decisions, state transitions
Nested Conditions NPC type → proximity → inventory (3 layers)
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
Math Ops `+=`, `*`, `Math.pow()`
String Ops Template literals for sprite paths
Boolean Expressions `&&`, `||`, `!`
Canvas Rendering `draw()` via `requestAnimationFrame`
Keyboard Events `keydown` / `keyup` for movement
GameEnv Config Object literal world configuration
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