2D game techniques
One technique per page, like torchlight that stops at walls or a jump that forgives a late press. Each has tested code, the numbers that matter and a prompt you can copy into your coding agent.
Terrain and nature
2D water shorelines with a distance fieldShallows, foam and waves that follow every bay of a 2D tile coastline, from one distance map baked at load. With a bake script, a Godot shader and pitfalls.
Wang tiles for pixel art, explainedOne repeated tile always shows a grid. Wang tiles fix it with 16 tiles whose edges match. How they work, how to place them, and how to cut them from a texture.Light and depth
4 ways to keep the player visible behind trees and walls in a 2D gameFade, dither, cutout and silhouette, the four standard ways to show a character who walks behind a tree or a wall. What each one does to pixel art, when to switch it on, the numbers, a tested Godot script with its shader, and the pitfalls.
Atmospheric perspective for 2D parallax backgroundsWhy stacked parallax layers look flat, and how to fix it by blending each layer toward the sky's color by distance. With the amount for each layer, a tested Godot shader and the pitfalls.
2D shadowcasting for torchlight, fog of war and line of sightTorchlight that stops at walls, fog of war and enemy line of sight, all from one roguelike algorithm. With tested Python and Godot code and the pitfalls.Game feel and UI
Coyote time, jump buffering and corner correction for 2D platformersThree small bits of forgiveness that make a platformer feel fair. A late jump off a ledge, an early jump before landing and a nudge past a corner, with the numbers, tested Godot code and the pitfalls.
Hit stop, hit flash, knockback and 5 more ways to make hits feel heavyEight small effects that make a sword hit feel heavy in a 2D game, from hit stop to damage numbers, with the frame counts and pixel sizes for each, a tested Godot script and the pitfalls.Pixel rendering