Physics

This page details the physics in Boxel 3D.

Engines:

The game uses matter.js and three.js.

Basic movement:

Jumping:

Jumping is the only main input in Boxel 3D while in jump mode. It can be activated by pressing Space, Enter, the W key, or clicking anywhere on the screen. Holding [space, w, enter] will jump repeatedly without stopping (autojump), but with clicking, it will only jump once per active click (manual). Manual jumps can actually be faster, because the frequency of your click is often more than the frequency of the autojump. After touching a physical block, if the player is in freefall, you can use a second jump. When starting a level, if you are in midair, you're given a second jump even though you haven't touched an object yet.

Grapple:

Grappling is the other input, and can only be used after touching a Grapple Cube which activates grapple mode. It can be activated by clicking. When you click on the screen, a rope between the wall that the mouse is pointing and the Player Cube will be created. You can then swing on the rope. The rope gradually shortens in length. This lifts you off the block and helps propel you forward. Jumping is not possible in grapple mode.

Gravity:

Gravity blocks will change the direction of gravity depending on the direction the block is facing. Velocity is conserved, and it affects all untethered objects, not just the Player Cube.

More advanced movement:

Clipping a corner:

Jumping from underneath a block and hitting its corner can propel you forward in the direction that the corner faces. Similarly, falling down on a corner will also propel you forward. This is an easy way to gain momentum.

"R" abuse:

You can abuse the R key to gain a jump at the start of a level. Hold the key down, and jump when you're ready. Notably, this can be exploited in Campaign Level 25.