An Electromagnetism Learning Game
A browser game built to help teach an introductory electromagnetism and circuits course, made as a university Servicio Comunitario (community‑service) project with Cristhian Bravo and Said Alvarado. It is written in JavaScript on Phaser 2.
Play It
Opens in a new tab. Use the mouse to aim and launch; press M for the in‑game menu.
The Charge Puzzles
Six levels (the first is “Electro Dash”) built around Coulomb's law and the electric field of discrete charges. You click and drag to launch a charged particle from a start zone; fixed charges placed around the level bend its path — same polarity repels, opposite attracts, and the force grows as the particle gets closer — and you have to land it in the target portal. A dotted aim line and a trajectory trail make the physics visible as you play.
A charge puzzle — land the particle in the portal, working with (and against) the fixed charges.
The Platformer
A second mode: a tile‑map platformer (Phaser Arcade physics) where the player crosses rooms of lasers, switches, doors and moving enemies, wiring up circuits to open the way out.
Glossary
The menu also has a glossary of short reference cards for the course topics the levels illustrate:
- Coulomb's law for discrete charges
- The electric field of discrete charges
- Electric currents
- Discrete elements: push‑buttons
- Passive elements: resistance
Repository
The game lives in the game/ folder of this site's repository — index.html loads Phaser and every game state, js/ holds the charge‑puzzle levels, glossary and menus, and p_js/ holds the platformer. It runs from any static web server; there is no build step.