A comprehensive step-by-step tutorial series for building a Dino Runner game using Deno and TypeScript. Learn modern web development by building a complete game from scratch!
You can either clone this repository with all submodules to explore the code, or start with a specific stage. We've created easily deployable starter kits for each stage, allowing you to focus on learning without worrying about setup. We've also provided the finished packages if you'd rather see the completed code and read through it yourself.
We want to make this tutorial as accessible as possible, so you can choose your own adventure! Choose the approach that suits you best from below and start building your Dino Runner game today!
Each starter kit is designed to be easily deployable on Deno Deploy. You can start with any stage, but we recommend starting with Stage 1 to build a solid foundation, then progress through the stages sequentially, the readme files in each stage will guide you through the process.
If you prefer to see the completed code for each stage, you can deploy the finished packages directly. This allows you to explore the final implementation and understand how each part of the game works. The readme files in each stage will provide insights into the code structure and functionality.
Stage | Focus | What You'll Learn | Get started |
---|---|---|---|
Stage 1 | Foundation & Setup | Basic web server, static files, API endpoints | |
Stage 2 | Enhanced Features | Canvas setup, drawing shapes, handling input | |
Stage 3 | Advanced Gameplay | Game logic, score tracking, advanced mechanics | |
Stage 4 | Database Integration | PostgreSQL, leaderboards, user customization |
If you'd rather clone this repo and see all the code in one place, you can run the stages directly from this monorepo. Each stage is organized as a submodule, allowing you to work on them independently while sharing the same workspace configuration.
git clone --recurse-submodules
cd game
# Development mode (auto-reload on file changes)
deno task dev:stage1 # Stage 1: Foundation
deno task dev:stage2 # Stage 2: Enhanced Features
deno task dev:stage3 # Stage 3: Advanced Gameplay
deno task dev:stage4 # Stage 4: Database Integration
# Production mode
deno task start:stage1 # etc...
cd packages/stage-1
deno task dev
# Stage 1
deno task start:stage1
# Stage 2
deno task start:stage2
# Stage 3
deno task start:stage3
# Stage 4
deno task start:stage4
- Basic web server setup with Oak
- Static file serving
- Simple API endpoints
- Health checks
- Environment configuration
- Improved error handling
- Extended API functionality
- Game logic implementation
- Score tracking
- Advanced game mechanics
- PostgreSQL database integration
- User customization features
- Global leaderboard system
- Data persistence
- @oak/oak: Web framework for Deno
- pg: PostgreSQL client (Stage 4 only)
All dependencies are managed at the workspace level in the root deno.json
.
This repository uses git submodules to organize each tutorial stage. Here are some useful commands:
git submodule update --remote
Or if you have local changes to preserve:
git submodule foreach --recursive 'git fetch origin && git reset --hard origin/main || echo "Could not reset $name"'
git add .
git commit -m "Update all submodules to latest versions"
git submodule update --remote packages/stage-1
git submodule update --init --recursive
git submodule status
Each stage is maintained in its own repository, allowing for independent development and version control while keeping the tutorial organized in a single place.
Each stage can be developed independently while sharing the workspace configuration. The stages are designed to be educational, showing progressive enhancement of the game from basic setup to full database integration.