Celeste
Maddy Thorson and Noel Berry's 2018 precision platformer.
On this page
Maddy Thorson and Noel Berry released Celeste’s player class under the MIT license, “as a learning resource and for general interest”. The release includes the built-in C# port of Celeste Classic. The license excludes the game and its assets.
All of Madeline’s movement sits in one file, Player.cs, which the developers call a conscious choice to keep its order of operations readable1. The release omits the engine classes it calls (Actor, Engine, and Calc). Some details below rest instead on the public Monocle source and Thorson’s physics write-up.
#Jumping
A jump sets the vertical speed to -105 px/s2,3. For variable jump height, holding jump keeps that speed for up to 0.2 s4,5, then halves gravity near the apex6.
Gravity is 900 px/s²7, with a normal fall limit of 160 px/s8. Units are pixels per second, multiplied by Engine.DeltaTime each update9. Positions are whole pixels, with the fraction kept in a subpixel remainder10.
Coyote time, the grace window after leaving a ledge, is 0.1 s11,12.
References
- ^The developers chose one large file of long methods for the player's behavior, so its tightly ordered logic reads in sequence. T2NoelFB/Celeste · Source/Player/Readme.md L16
- ^A normal jump sets Madeline's vertical speed to
JumpSpeed, −105 px/s. T3NoelFB/Celeste · Source/Player/Player.cs L49 - ^
Jump()sets vertical speed toJumpSpeedplus any platform lift boost, saves it asvarJumpSpeed, startsvarJumpTimeratVarJumpTime, and zeroes the grace timer. T3NoelFB/Celeste · Source/Player/Player.cs L1660–1673 - ^
VarJumpTime, how long holding jump can keep the take-off speed, is 0.2 s. T3NoelFB/Celeste · Source/Player/Player.cs L51 - ^While
varJumpTimerruns, holding jump keeps Madeline rising no slower thanvarJumpSpeed, canceling gravity; releasing zeroes the timer and cuts no speed. T3NoelFB/Celeste · Source/Player/Player.cs L2960–2966 - ^Gravity halves while |
Speed.Y| is underHalfGravThresholdand jump is held (or auto-jump is on), so a held jump hangs at the top. T3NoelFB/Celeste · Source/Player/Player.cs L2952 - ^Celeste's gravity is 900 px/s²; each airborne update moves vertical speed toward the fall limit by
Gravity * mult * Engine.DeltaTime. T3NoelFB/Celeste · Source/Player/Player.cs L24, L2957 - ^
MaxFall, the normal limit on falling speed, is 160 px/s;NormalBeginstartsmaxFallthere and gravity approaches it. T3NoelFB/Celeste · Source/Player/Player.cs L23, L2760–2763 - ^In each update,
Player.Updateticks both jump timers, the state machine runsNormalUpdate(gravity, hold, and new jump), and thenMoveVappliesSpeed.Y * Engine.DeltaTime. T3NoelFB/Celeste · Source/Player/Player.cs L742–744, L908, L934–935, L322–323JamesMcMahon/monocle-engine · Monocle/Entity.cs L95–98 - ^Celeste's actors sit on whole pixels;
MoveVadds the float distance to a remainder, moves by its rounded value, and keeps the fraction. T2Thorson 2020 · Actor BasicsNoelFB/Celeste · Source/Player/Player.cs L935 - ^
JumpGraceTime, Celeste's coyote time, is 0.1 s. T3NoelFB/Celeste · Source/Player/Player.cs L48 - ^Grounded updates refill
jumpGraceTimer; airborne ones subtractEngine.DeltaTimebeforeNormalUpdate, which jumps on a press while it is above zero. T3NoelFB/Celeste · Source/Player/Player.cs L713–720, L2970–2975
Sources
Code
- Thorson, Maddy and Noel Berry. 2021. “Celeste: released class files (NoelFB/Celeste).” Commit 1b0ce45. NoelFB/Celeste @ 1b0ce45 · licence, all uses
- Thorson, Maddy. 2018. “Monocle Engine (public source, GitHub mirror JamesMcMahon/monocle-engine).” Commit 759c15a. JamesMcMahon/monocle-engine @ 759c15a · licence, all uses
Primary
- Thorson, Maddy. 2020. “Celeste and TowerFall Physics.” Medium. original · archived · licence, all uses