22 posts, newest first
-
Platform
Why this site has no build step
Fifty-one pages, sixteen games and not one build command between them. That is a decision with real costs, and knowing what they are is the only way to know whether it was the right one.
-
Testing
Testing a game in a fake browser
Sixteen games are played to completion on every change, in about nine seconds, with no browser involved. Here is the fake browser they run in and the class of bug it is good at finding.
-
Accessibility
prefers-reduced-motion for games
The setting exists for people who get ill, not people who get annoyed. Working out what a game can honestly switch off, and the one thing it cannot, took longer than expected.
-
Accessibility
Making a canvas game playable by keyboard
Sixteen games here are playable without a mouse. That took more than adding key handlers, and the interesting part is the gap between a page a keyboard can reach and a game a keyboard can play.
-
Platform
What localStorage can and cannot do
The obvious place to keep a high score is the one that throws an exception in a private window. What localStorage will and will not do, and the three-line wrapper that stops it taking the game down with it.
-
Audio
Sound with no audio files
Every sound on this site is generated at the moment it plays. There is not one audio file in the repository, and the whole sound engine is smaller than a single second of recorded music.
-
Physics
The kinematic bicycle model
The car in Precision Parking cannot turn on the spot, and that is not a limitation to work around. It is the whole game, and it falls out of one line of trigonometry.
-
Physics
Slip angle: the physics of a drift
The difference between a car that grips and a car that drifts is one angle, and it is measurable. Understanding it is what stops a driving game feeling like a car on rails.
-
Design
Why merge games feel good
A merge game is a stacking simulation with a scoring table bolted on. Which numbers you choose in that table decides whether the game is a toy you shake once or a game you keep coming back to.
-
Theory
Sokoban is PSPACE-complete
Pushing crates around a grid is provably one of the hardest kinds of puzzle there is, and that result is not trivia. It explains why the levels are hand-built and why the undo key is not optional.
-
Theory
How many clues does a Sudoku need?
A Sudoku is not a puzzle because it is hard. It is a puzzle because it has exactly one answer, and checking that is the whole job of writing a generator.
-
Theory
Minesweeper's 50/50 problem
On the hardest board, a good player still loses a share of games to a coin flip. Working out how often that happens is a counting problem, and it decides whether a Minesweeper clone is honest.
-
Theory
Snake and the Hamiltonian cycle
There is a strategy that never loses at Snake, and it has been known since the game was written. The reason it is not the answer to a good Snake game says something about what makes a game worth playing.
-
Physics
Breakout's reflection bug
Almost every Breakout clone copies the same five lines. The clamp in them flattens the outer tenth of the ratio range past the paddle, and a narrow paddle loses twice what a wide one does.
-
Design
Points, combos and multipliers
A score is a sentence about how the run went, not a measure of it. The multiplier is the clearest example: it rewards a decision the player makes under pressure rather than the time they spent.
-
Design
Difficulty curves that work
Ramping difficulty is a shape, not a number. The three shapes used on this site behave very differently once a player has been at a game for five minutes, and only one of them survives a bad run.
-
Systems
Seeded randomness, and why you want it
A game that uses Math.random produces a different run every time, which means the interesting bug you just saw is gone forever. Six lines of arithmetic fix that, and cost nothing.
-
Physics
AABB, circles and SAT: picking a hitbox
Nearly every 2D game on this site uses one of three tests. Each has a shape it is honest about and a shape it lies about, and picking the wrong one is how a player ends up convinced the game cheated.
-
Game feel
Coyote time and input buffering
A jump that only works on the exact frame the player pressed it is a jump that feels broken. Two countdown timers fix the two halves of the problem, and neither one changes the game's difficulty.
-
Game loop
Fixed timestep or delta time?
Multiply by delta and your physics stops being reproducible. Skip the multiply and your game runs at a different speed on every machine. There is a third option, and it is about eight lines long.
-
Rendering
Why your canvas looks blurry
A canvas has two sizes and most games set one of them. That is the entire reason a game looks soft on a laptop and fine on a monitor, and the fix costs four lines and one transform.
-
Performance
The 16.6 ms frame budget
A game at 60 FPS has 16.6 milliseconds to do everything. Here is the split between input, simulation, drawing and the browser's own work, and how to find out which one you are overrunning.