The Database: everything Core loads at boot.

Core

Jumping and Gravity

reactor_physics.js · 2,216 lines · 99 public functions

The Database: everything Core loads at boot.

What This Module Does

On 3D maps: a character has a height and a vertical speed. Jumping gives the player an upward speed; gravity takes it away frame by frame; walking or jumping off a ledge falls; a jump carries a character over anything below its height and lands it there, a walk off an edge comes down where it stepped off. Landing after a long fall can hurt the party or run a common event. Water deeper than a character stands is swum: it floats with its head out, moves slower, never dashes, climbs out onto a low bank and can jump from the water; a fall into water dips under and bobs back up without hurting. A ledge too high to jump onto but within reach of raised hands is mantled: grabbed and climbed. ReactorPhysics.edge answers what a body can do between two cells (walk, hop, mantle, ladder, drop, blocked) from the map's data alone. Gravity and jump height are the project's (System.json reactorPhysics), and a map may have its own (MapNNN.r3d.json › physics). Gravity is in Earths: 1 is 9.8 m/s² at 0.6 m to a tile.

Classes & Namespaces

View reactor_physics.js on GitHub · Hide internal (_) functions