Games: first issues
What /games is for, and the first problems found while building it: what was seen, the cause, and where each one stood.
What /games is for
I want to host thousands of browser games. I find it fun to curate and manage browser games at scale, and doing it well is an interesting technical challenge.
How a game gets onto /games
A game is an artifact: one HTML file, shown inside a frame on the site. It appears on /games when it is published, tagged browser-games, and has both a screenshot and its HTML file.
Every game also has its own page (for example /artifacts/stackfire), where it plays inside the article instead of fullscreen.
Issues
1. A drawer's dim covered only part of the screen
Seen: on an iPhone, opening the ellipsis drawer over a fullscreen game dimmed only part of the screen. The dim was turned off altogether as a stopgap.
Cause: not the game's frame. On iOS the dim is positioned from the page instead of from the screen, so that it reaches under Safari's translucent bars. That only works when body is position: relative, and the site didn't set it. Without it the dim was one screen tall and sat at the very top of the page, so on a scrolled page it covered part of the screen or none of it. Games are usually opened from partway down /games, which is why it showed there. Every drawer on a scrolled page had the same fault.
Now: body is position: relative, and drawers dim the page again (45% black, no blur). A drawer opened from inside the phone menu dims the menu too. Not yet tested on an iPhone.
2. Blur behind a drawer glitched
Seen: on an iPhone, the blurred backdrop behind a drawer glitched, worst on /games.
Cause: not proven. The likely one is a full-page blur laid over the page's own blurred glass and the blurred glow behind every card.
Now: drawers don't blur the page. The dim alone does the job, as it does for the modals on larger screens.
3. The controls slid over the game while scrolling
Seen: on a game's own page, the bar of controls under the game stayed at the bottom of the screen and slid over the game as the page scrolled.
Cause: it was built that way: the bar stuck to the bottom of the window while any of the game was on screen. It only showed where the game was taller than the screen, which in practice meant phones.
Now: the bar sits under the game and scrolls with it, as one item. Fullscreen is unchanged. Not yet checked in a browser.
4. Stackfire scrolls inside its frame
Seen: a game is meant to report its full height so its frame can fit it and never scroll. Stackfire still scrolls inside its frame.
Measured on /artifacts/stackfire:
The phone row is a phone-sized desktop window, not a real phone.
Cause: Stackfire caps its canvas at 76vh, and inside a frame vh is the frame's height.
- The frame starts at a default height, and the game reports the height its content has at that size.
- The site resizes the frame to the reported height.
- That makes
76vhbigger, so the canvas grows and the content is now taller than the frame. - The game reports once and the site stops listening after the first report, so the frame stays too short.
Options:
- Remove the
76vhcap from Stackfire. This fixes Stackfire only. - Keep reporting until the height settles. This fixes every game sized this way, but the height arrives in several steps, and it gives up the "report once" rule that stops a page growing forever with its frame.
Now: open, left as it is for the moment. Which other games size themselves from vh hasn't been checked.
Limits that will matter at scale
These come from reading the current code. None has caused a problem yet.
- One request per game. The list of games doesn't include each game's HTML file, so
/gamesasks goatboat for every game's page separately. - Every game on one page. The wall shows all the games at once, with no paging, search or filtering.
- Eight colour palettes. Cards take their colours in turn, so the colours repeat after eight games.
- The site can't see inside a game. Each game is its own HTML file with its own CSS. Issue 4 can come back with any game, and the site only finds out by someone looking.
Related
- Stackfire
A falling-block puzzle where you aim and fire unlimited shots to clear rows. Rotate pieces and hard-drop with keyboard controls.
- Solaris Breaker
A tactile 3D kinetic arcade brick breaker with multiball physics, explosive chain reactions, and precision paddle combat.
- CourtSide Ping Pong 3D
A sunlit 3D table tennis game inspired by Wii Sports, with spin physics, responsive paddle swings, and tournament opponents.
- Quadrant Brick Breaker
A four-quadrant brick breaker with a central paddle, five power-ups, and increasingly tough waves.