TechNoviceTools — Processing Apps — Narnia Saga

Narnia Simulation  — Stage 10

The White Witch turns humans to statues.
Aslan hunts them down and sets them free.
Based on C.S. Lewis’s The Lion, the Witch and the Wardrobe.

About this simulation

This simulation involves interactions between four kinds of Molecools — the TNT name for particle objects that move, collide, and interact with one another:

  • Beige Humans wander around aimlessly, bouncing off each other with elastic (momentum-conserving) collisions.
  • Blue White Witch moves intentionally; any Human she touches is frozen into a gray Statue.
  • Orange Aslan pursues the nearest Statue and frees it back into a Human on contact. He turns red whenever any Statues exist.
  • Gray Statues are frozen Humans — immobile until Aslan reaches them.

All non-Statue interactions conserve momentum elastically. This is Stage 10 — the ES6 class syntax upgrade. Stage 8 behavior is preserved exactly; the improvement is internal: Grid and Molecool are now true ES6 class declarations with a constructor() method and class-body methods, ready for Stage 11 inheritance.

Characters (Molecools)
Human Wanders aimlessly. Bounces elastically off other Molecools. Turned to a Statue by the White Witch.
White Witch Pursues and freezes Humans into Statues on contact. Always moving, always hunting.
Aslan Seeks the nearest Statue and frees it (becomes a Human again). Orange when no statues exist; turns red when hunting.
Statue A frozen Human. Cannot move. Restored to Human when Aslan touches it.
Controls
  • Left Click Start or pause the simulation
  • Right Click Add a Human at the click position (up to max population of 10)
  • Slider Adjust the frame rate (15–60 fps)
  • Save Image Download the current canvas frame as a PNG file

Right-click adds Humans only after starting and while paused.

About Stage 10
SPARK Edition

Stage 10 converts Grid and Molecool from pre-ES6 constructor functions to true ES6 class declarations. The simulation behavior is identical to Stage 8; the change is structural: methods are now defined in the class body and shared via the prototype, not re-created on every new call. Stage 8 encapsulation improvements are fully preserved.

Teaching concept: ES6 class syntax — modern JavaScript classes are prototype-based under the hood (same as Stage 8), but the class keyword makes the programmer’s intent explicit and lays the structural foundation for Stage 11 inheritance.