Skip to content

brittLiban/dvdGame

Repository files navigation

DVD Corner Rush

A fast-paced arcade browser game built with Rust and the Bevy game engine, compiled to WebAssembly so it runs directly in any modern browser — no install needed.

Inspired by the classic bouncing DVD screensaver, DVD Corner Rush turns a nostalgic screensaver into a skill-based prediction game. Watch the logo bounce around the screen and press Space at the exact moment it's about to hit a corner. The closer you are, the more points you earn.


How to Play

  1. Enter your name on the home screen and press Enter
  2. Choose a difficulty — Easy, Medium, or Hard
  3. Watch the bouncing DVD logo and press Space when it's near a corner
  4. Score as many points as you can before the 60-second timer runs out
  5. Press R on the game over screen to see the leaderboard and play again

Scoring

Points are awarded based on how close the logo is to a corner when you press Space:

Distance from corner Result Points
Within 80 px Perfect! +100 to +200 (closer = more)
80 – 160 px SO CLOSE... Score resets to 0 (Easy & Medium only)
Beyond 160 px Miss −0 to −40 (farther = more penalty)

Difficulty Modes

Easy Medium Hard
Speed Slow Fast Very fast
Corner guides Visible Visible Hidden
Close miss Resets score Resets score Just a penalty
Logo jumps No No Yes — teleports randomly
Screen flashes No No Yes — random color bursts

Easy

The corner zones glow to show you exactly where to aim. Good for learning the timing.

Medium

Same glowing guides but the logo moves significantly faster. You have less time to react.

Hard

No guides. The logo moves at near-unplayable speed, randomly teleports to a new position every few seconds, and random color flashes strobe across the screen to break your focus. There is no score reset on near-misses — just raw distance-based penalties.


Controls

Key Action
A – Z Type your name on the home screen
Backspace Delete a character
Enter Confirm name / continue
E / M / H Select Easy / Medium / Hard
Space Make a corner prediction during gameplay
R Return to home screen after game over

Leaderboard

The home screen displays the top 5 scores for each difficulty mode from the current session. After pressing R on the game over screen, your score appears on the board automatically.

Scores are stored in memory for the current browser session. Refreshing the page resets the leaderboard.


Local Development

Prerequisites

Tool Install
Rust Installed automatically via the setup below
trunk Build tool for Rust → WASM
MSYS2 + GCC Windows linker (already configured if you cloned this repo)

First-time setup (Windows)

These tools are already installed if you followed the original setup. If starting fresh:

# Install Rust
winget install --id Rustlang.Rustup -e --silent

# Add WASM target
rustup target add wasm32-unknown-unknown

# Install MSYS2 (provides the GCC linker on Windows)
winget install --id MSYS2.MSYS2 -e --silent
C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-x86_64-gcc

Run the dev server

Option 1 — Double-click:

run.bat

Option 2 — Terminal:

$env:PATH = "C:\msys64\mingw64\bin;$env:USERPROFILE\.cargo\bin;$env:PATH"
trunk serve

Then open http://localhost:8080 in your browser.

The first build takes 10–20 minutes (compiling Bevy). Subsequent builds take under 15 seconds.


Deployment to Vercel

One-time setup

# Install the Vercel CLI (requires Node.js)
npm install -g vercel

# Log in to your Vercel account
vercel login

Deploy

Option 1 — Double-click deploy.bat

Option 2 — Terminal:

$env:PATH = "C:\msys64\mingw64\bin;$env:USERPROFILE\.cargo\bin;$env:PATH"

# Build optimized WASM bundle
trunk build --release

# Deploy the dist/ folder to Vercel
vercel dist --prod

Vercel will give you a live URL. Update the Play It link at the top of this file.


Project Structure

dvdGame/
├── src/
│   └── main.rs          # All game code — one file, clearly sectioned by sprint
├── Cargo.toml           # Rust dependencies (Bevy 0.15)
├── Trunk.toml           # WASM build config (serves at port 8080)
├── index.html           # Browser entry point
├── vercel.json          # Vercel deployment config
├── run.bat              # Double-click to run locally
├── deploy.bat           # Double-click to build + deploy to Vercel
└── .cargo/
    └── config.toml      # Linker config (points to MSYS2 GCC on Windows)

Tech Stack

Technology Role
Rust Programming language
Bevy 0.15 Game engine (ECS architecture, 2D rendering, input, audio)
WebAssembly Compile target — runs in any modern browser
trunk WASM bundler and dev server
Vercel Static site hosting

Class Reflection — Vibe Coding

This project was built entirely through a Vibe Coding class activity using Claude Code as an AI coding partner. Neither Rust nor Bevy was known beforehand.

What the AI handled well

  • Writing all Rust and Bevy boilerplate from scratch
  • Debugging WASM-specific build errors (wrong linker, getrandom backend)
  • Explaining every code change in beginner-friendly terms
  • Iterating quickly on design changes without rewriting the whole project
  • Setting up the full dev environment (Rust, MSYS2, trunk, Vercel config)

What was difficult

  • Getting the WASM build to work on Windows required several rounds of debugging (Git's link.exe shadowing the correct linker)
  • Bevy's API is version-sensitive — some features worked differently than documented
  • Corner detection required math reasoning (the logo physically can't reach the screen corner pixels, so thresholds had to be recalculated)
  • Balancing difficulty felt different in-game than on paper — needed manual tuning

What I learned

  • How game engines use an Entity Component System (ECS) to separate data from logic
  • How Rust + WebAssembly enables native-speed games in the browser
  • How to build a game incrementally in sprints rather than all at once
  • How to communicate design intent to an AI and iterate on the result

License

MIT — free to use, fork, and learn from.

About

DVD Corner Rush — arcade timing game built in Rust with Bevy, compiled to WebAssembly to run in the browser.

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors