Menu
A charge-puzzle level: two orange fixed charges and a blue target portal in a sci-fi tunnel, with a dotted trajectory trail showing a launched particle's curved path

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

▶  Play the game

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 in progress: the particle's dotted trail curves between two orange fixed charges on its way to the blue target portal

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.

Posted In:
Web Applications