feels.module
README.md
feels
Platformer movement feels as plain data: every number the twoDKit.Player2D motor runs on (run speed and acceleration, variable jump height, gravity, apex hang time, coyote time, jump buffer, wall slide and wall jump, dash), grouped into named presets. Player2D.feel picks one by id; register your own to tune the controls without touching code.
Units are tiles (world units, 16 art pixels) and seconds.
Presets (Feels.list)
tight: snappy and precise (Celeste-like): instant turns, quick fall, short hops on a tap, fast long dash.floaty: low gravity, long hang at the top of the jump, drifting air control, long slow dash.heavy: slow to start, short strong jump, slams down, little air control, short punchy dash.slippery: on ice: high top speed, long slides to stop or turn, momentum carries through jumps.classic: momentum platforming: builds up to a high top speed, slides a tile when you let go, big steerable jumps.nimble: an acrobat: two dashes per jump, high wall jumps off slow wall slides, instant and light.moon: barely any gravity: six-tile jumps lasting almost three seconds, slow drift down, gentle steering.retro: 8-bit committed jumps: one fixed arc however long you hold, almost no air steering, instant on the ground.
Fields of a feel
Running: maxRun, groundAccel, groundDecel, turnAccel, airAccel, airDecel, groundFriction (multiplies ground deceleration and turning; all presets use 1). Jumping: jumpHeight (apex of a held jump), riseGravity, fallGravity, cutGravity (after jump is released: short hop), apexHang (gravity multiplier near the apex while held), apexWindow, maxFall, coyoteTime, jumpBuffer, landSquash. Walls: wallSlide (max slide speed), wallJumpX, wallJumpHeight, wallJumpLock (seconds the wall jump overrides steering). Dash: dashSpeed, dashTime, dashCount (dashes per air time), dashEndScale, dashCooldown, overspeedDecel (on the ground, speed above maxRun after a dash bleeds off at least this fast). Plus id, label, description.
API
Feels.get(id?) -> Feel: a preset (unknown or nil givestight).Feels.copy(id) -> Feel: a shallow copy to edit.Feels.register(id, t) -> Feel: add or replace a feel; numbers you leave out come fromtight. It joinsFeels.list, so the HUD's FEEL picker offers it.Feels.jumpVelocity(height, gravity): launch speed that peaks atheight.Feels.byId,Feels.list.
local Feels = require("twoDKit.feels")
Feels.register("moon", { label = "Moon", description = "Huge, slow jumps.", jumpHeight = 6, riseGravity = 12, fallGravity = 15 })
body.component.get("twoDKit.Player2D"):setFeel("moon")