Part of the
make-game skill. The skill links here when your agent needs the detail.2d-platformer.md
feels good. Combat mechanics reuse the combat-basics skill.
Patrol enemy
ACharacterBody2D that walks, turns at ledges/walls, and hurts on contact. Ledge
detection via a downward RayCast2D at the front foot.
combat-basics.
Stomp-to-kill
The classic platformer verb. A separate Area2D under the player masking only the Enemies layer; on overlap, kill the enemy and bounce the player.velocity.y > 0) distinguishes a stomp from a side hit that should damage
the player instead.
Hazards
- Spikes/lava: an Area2D on the Triggers layer that calls
player.die(). - Bounce pad: Area2D that sets
player.velocity.y = -launch_forceon enter. - Bottomless pit: one wide killzone under the level.
Juice (the difference between prototype and game)
Route through a small helper so every hit feels alive:- Hit flash:
modulateto white, tween back over 0.06s. - Screen shake: offset the Camera2D by decaying random noise for ~0.2s.
- Hitstop:
Engine.time_scale = 0.05for one frame on a kill, then back to 1.0. - Floating text: spawn a Label that rises and fades on coin/hit.
- Squash/stretch: tween the sprite
scaleto (1.2, 0.8) on land, back over 0.1s. - Dust particles on land and on turn.
Progression: coins, gems, and a level goal
- Coins increment
GameManager.score; emitscore_changedfor the HUD. - A
level_endArea2D (flag/door) triggers the level-complete screen with time and coin count, then advances to the next room.tscn. - Save unlocked rooms + best times via the
save-loadskill.
Metroidvania gating (optional)
For an interconnected map with ability gates:AbilityManagerautoload:unlocked: Dictionary,has(name),unlock(name).- Ability pickup: Area2D that calls
AbilityManager.unlock("double_jump"). - Ability gate: a wall/door that only opens if
AbilityManager.has("dash"), or a ledge only reachable with double jump. - The player controller checks
AbilityManager.has("double_jump")before allowing a second air jump,has("dash")before a dash, etc.
Traps
- Enemies as RigidBody2D fight the player physically; use CharacterBody2D or Area2D.
- Stomp check without a
velocity.y > 0guard kills enemies on any touch. - Ledge raycast that does not flip with direction walks enemies off cliffs.
- Piling on juice at once (shake + hitstop + flash on every coin) reads as noise; reserve the big feedback for kills and damage, keep coins light.
Source:
library/skills/make-game/references/2d-platformer-polish.md, rendered from summer-engine@4.3.0 on npm.
