---
title: "Build a dinosaur runner game with Deno, pt. 2"
description: "Stage 2 of a Deno dinosaur runner tutorial turns a static landing page into a playable HTML5 canvas game."
url: "https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-2-c8e56eec683a558c"
canonical: "https://deno.com/blog/build-a-game-with-deno-2"
source: "Deno"
published: "2025-12-15"
difficulty: "medium"
kind: "How-to"
reading_minutes: 10
tags: ["gaming","javascript","frontend","browsers"]
---

# Build a dinosaur runner game with Deno, pt. 2

A post on [Deno](https://swe.quest/sources/deno.md), published 2025-12-15, 10 min read, How-to. Original: [https://deno.com/blog/build-a-game-with-deno-2](https://deno.com/blog/build-a-game-with-deno-2)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Games](https://swe.quest/tags/gaming.md) (Domains)
- [JavaScript](https://swe.quest/tags/javascript.md) (Languages)
- [Frontend](https://swe.quest/tags/frontend.md) (Web & mobile)
- [Browsers](https://swe.quest/tags/browsers.md) (Web & mobile)

## Prerequisites

- JavaScript classes ([easy posts on JavaScript](https://swe.quest/tags/javascript.md?difficulty=easy))
- HTML and CSS basics ([easy posts on CSS](https://swe.quest/tags/css.md?difficulty=easy))
- Canvas 2D API basics

## Keywords

Deno, Deno Deploy, HTML5 Canvas, requestAnimationFrame, Oak

## Related posts

- [Build a dinosaur runner game with Deno, pt. 3](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-3-210f2045426eb0c9.md): Deno · 2025-12-22 · Medium · 9 min read · Games, JavaScript, Frontend
  Part 3 of a Deno tutorial series adds obstacles and collision detection to a canvas-based dinosaur runner game.
- [Build a dinosaur runner game with Deno, pt. 1](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-1-e4d3faa91fec67fd.md): Deno · 2025-12-08 · Medium · 5 min read · JavaScript, TypeScript, Deployment, Serverless
  Part one of a series building a browser dinosaur runner game sets up a Deno project that serves static files and deploys it.
- [Build a dinosaur runner game with Deno, pt. 5](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-5-5afa507e9804672c.md): Deno · 2026-02-09 · Medium · 9 min read · JavaScript, PostgreSQL, Games, Frontend
  Part five of a Deno tutorial series adds player identity and customization to a browser dinosaur runner game.
- [Build a dinosaur runner game with Deno, pt. 6](https://swe.quest/articles/build-a-dinosaur-runner-game-with-deno-pt-6-d21d409df6156ed0.md): Deno · 2026-02-23 · Medium · 9 min read · Observability, JavaScript, TypeScript
  The final stage of the Deno dinosaur runner series adds observability using Deno Deploy's built-in logs, traces and metrics dashboards.
- [Leveraging Docker with TensorFlow Models & TensorFlow.js for a Snake AI Game](https://swe.quest/articles/leveraging-docker-with-tensorflow-models-tensorflow-js-for-a-snake-ai-game-0310fd6dfebd2c17.md): Docker · 2025-03-18 · Medium · 10 min read · Containers, Machine learning, JavaScript, Games
  A 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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
