Play the battle on the left — every click runs a method, and the exact lines of code
that fire light up on the right — great for showing a class what objects actually do.
CLASSOBJECTINHERITANCEPOLYMORPHISMENCAPSULATION
HOW TO USE
How to play
Click a creature to choose it. A wild one appears to fight.
Click ATTACK (the shared move) or SPECIAL (each type's own move).
Watch the code on the right light up — those are the exact lines that just ran.
Fire > Earth > Water > Fire. Hitting a type you're strong against does double damage ("super effective").
Click NEW BATTLE to start again with a fresh creature.
What it teaches
Class & Object: choosing a creature runs new Fire(...) — an object built from a class.
Inheritance: every creature shares attack() from the base Pokemon class.
Polymorphism: SPECIAL calls specialMove() — same name, different behaviour per type.
Encapsulation: health only ever changes through takeDamage().
The five tags near the top flash as each idea happens.
◄ CLICK A CREATURE TO CHOOSE ►
VS
pokemon.js — live
call log — methods that have runclick a step to replay its code →