Dash & Slash is a small one-hand roguelite I build in Flutter. Every room is generated: a 13 by 21 tile grid, a door at the top, the player spawning at the bottom, and a few mirrored "stamps" of walls and pits in between. Shortly after version 1.0.0 went live on Google Play, a room turned up where the door opened and the player could never reach it.
The fix was three lines. The interesting part, at least for me as a QA engineer, is why the existing test could never have caught it.
How the generator works
The generator is deliberately boring. It fills the room with floor, puts walls on the border and a closed door in the middle of the top row:
for ( var c = 5 ; c <= 7 ; c ++ ) { map . set ( c , 0 , T . doorClosed ) ; }
Enter fullscreen mode
Exit fullscreen mode
Then it drops two to four wall stamps and a few pit stamps at random positions. Every stamp is mirrored onto the other half of the room, so layouts look designed even though they are random.…