OOPs Breakout (3-Part Mini Lesson)
%%{init: {
"flowchart": { "nodeSpacing": 70, "rankSpacing": 140, "curve": "linear" }
}}%%
flowchart LR
A[OOP Mini-Lesson]
%% invisible hubs to force a second tier (prevents squish)
A --> H1(( ))
A --> H2(( ))
classDef ghost fill:transparent,stroke:transparent;
class H1,H2 ghost;
%% main branches (now split across two hubs)
H1 --> L1[Lesson 1:<br/>Game Class & Inheritance]
H1 --> L2[Lesson 2:<br/>Paddle Class]
H1 --> L3[Lesson 3:<br/>Ball Class]
H2 --> Activity[Whiteboard Activity]
H2 --> Quizzes[Checkpoint Quizzes]
%% Lesson 1 details
L1 --> B1[Big Picture]
L1 --> B2[GameObject Base]
L1 --> B3[Child Classes]
L1 --> B4[Game Conductor]
%% Lesson 2 details
L2 --> C1[Attributes]
L2 --> C2[Methods]
%% Lesson 3 details
L3 --> D1[Constructor]
L3 --> D2[Methods]
%% Activity details
Activity --> E1[Draw boxes]
Activity --> E2[Show inheritance]
Activity --> E3[Props inside,<br/>methods outside]
%% Quiz details
Quizzes --> F1[Inheritance vs Composition]
Quizzes --> F2[Attributes vs Methods]
Quizzes --> F3[Constructors & Ball]
%% palette (same feel)
style A fill:#e1f5fe,stroke:#000,stroke-width:2px,color:#000
style L1 fill:#fff3e0,stroke:#000,color:#000
style L2 fill:#f3e5f5,stroke:#000,color:#000
style L3 fill:#e8f5e8,stroke:#000,color:#000
style Activity fill:#fff8e1,stroke:#000,color:#000
style Quizzes fill:#fce4ec,stroke:#000,color:#000
OOP Breakout: Lesson 1
The Game class & how inheritance works
OOP Breakout: Lesson 2
The Paddle class: attributes vs. methods
OOP Breakout: Lesson 3
The Ball class & constructors
OOP Breakout: Expert
*Very difficult extra game & lesson (not on mindmap!)
ACTIVITY: Showcase your learning in the blackboard below.
- Draw your “class” as a box → properties inside (like health, lives), methods outside (like move(), hitBrick()).
- Draw inheritance → a Paddle class, then draw a “PowerPaddle” subclass that has an extra feature (like shooting lasers).
Press r
to change brush color to red.
Press b
to change brush color to blue.
Press g
to change brush color to green.
Press c
to clear blackboard.
✅ Checkpoint Quizzes
Lesson 1 Checkpoint
Inheritance vs. Composition
1) Which classes inherit from
GameObject
?2) What is composition in the
Game
class?Lesson 2 Checkpoint
Attributes vs. Methods
1) Which of these are attributes of Paddle?
2) Which method makes the paddle respond to keyboard input?
Lesson 3 Checkpoint
Constructors & Ball
1) What does
super(x, y)
do in Ball’s constructor?2) What does
speedUp()
change?Wrap-up: how the pieces fit
- Inheritance:
Ball
,Paddle
,Brick
,PowerUp
extendGameObject
to share position and overridedraw/update
. - Composition:
Game
builds the world—instantiates objects, tracks score/lives/level, and runs the loop.