Build a dinosaur runner game with Deno, pt. 2
Stage 2 of a Deno dinosaur runner tutorial turns a static landing page into a playable HTML5 canvas game. A DinoGame class tracks game state, runs a requestAnimationFrame update/render loop, handles Space, arrow-up and click input for jumping, and applies simple gravity and velocity physics with a ground clamp. The stage also covers canvas rendering of a rectangle dino, DOM score and status helpers, reset logic and a health check against the Stage 1 Oak API, all deployable to Deno Deploy.
Related posts
- Build a dinosaur runner game with Deno, pt. 3
Deno mediumAdeptPart 3 of a Deno tutorial series adds obstacles and collision detection to a canvas-based dinosaur runner game. Cactus obstacles spawn on a frame timer, move left at the game speed, and award points when they leave the screen. An axis-aligned bounding-box overlap check ends the run, and a difficulty level computed every 200 points raises speed and shortens the spawn interval down to a floor. The stage also adds a simple leg animation, a game-over overlay, high scores persisted in localStorage, and redeployment with `deno deploy`.
- Build a dinosaur runner game with Deno, pt. 1
Deno mediumAdeptPart one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it. It covers `deno init`, adding the Oak framework from JSR, defining `dev` and `start` tasks in deno.json with explicit `--allow-net`/`--allow-read`/`--env-file` permissions, and a minimal Oak server that serves `public/` via `context.send`. It also adds an `/api` router with a health check endpoint, then deploys with `deno deploy` using `src/main.ts` as the entry point.
- Build a dinosaur runner game with Deno, pt. 5
Deno mediumAdeptPart five of a Deno tutorial series adds player identity and customization to a browser dinosaur runner game. Plain DOM modals collect a player name and preferences for dino color, background theme and difficulty. The DinoGame class loads settings from the server or localStorage and applies theme gradients and difficulty speed multipliers (0.8/1.0/1.3). New PostgreSQL `players` and `player_settings` tables back Oak routes under `/api/customization`, which use INSERT ... ON CONFLICT upserts to persist those choices.
- Build a dinosaur runner game with Deno, pt. 6
Deno mediumAdeptThe final stage of the Deno dinosaur runner series adds observability using Deno Deploy's built-in logs, traces and metrics dashboards. A logging middleware emits one structured JSON line per HTTP request, and route handlers log business events like score submissions and customization saves. Custom OpenTelemetry spans wrap the leaderboard, score submission and customization routes, carrying attributes, events and recorded exceptions. Platform metrics (status codes, latency, CPU, memory, GC time, bandwidth) are used to spot anomalies before drilling into traces, and the `--tunnel` flag sends local telemetry to the same dashboards for verification before deploying.
- Leveraging Docker with TensorFlow Models & TensorFlow.js for a Snake AI Game
Docker mediumAdeptA browser-based Snake game whose AI mode uses a TensorFlow.js feedforward network (dense layers 5→256→512→256→3, Adam at 0.001, MSE loss) to choose left, forward or right from the snake's surroundings, retraining on its recorded moves after each game. The static site is served from an nginx:latest container built with a two-line Dockerfile, and a bind-mounted volume gives live reload during development without rebuilding the image. The walkthrough covers the game loop, mode switching, training and prediction code, and a fix for Docker Desktop file-sharing mount errors.