Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🐎 极速赛马 · Turbo Derby

A lightweight horse-racing betting game for Telegram Mini Apps. Pick a horse, place a bet, and win bet × odds if your horse crosses first.

Built as a dependency-free static web app (HTML/CSS/vanilla JS) — no engine, no build step, instant load. Deployed on Vercel.

Structure

webapp/            # the game (served at site root)
  index.html       # single screen: balance, track, horse picker, bet bar
  styles.css       # dark-green / gold brand theme
  src/
    main.js        # UI + betting/race controller
    simulation.js  # odds-weighted race simulation + horse roster
    telegram.js    # Telegram WebApp lifecycle + haptics
    api.js         # /auth client with local guest fallback
api/               # Vercel serverless functions (auth / play / leaderboard)
vercel.json        # deploy config (outputDirectory = webapp)

Develop

No build needed — edit files under webapp/ and open webapp/index.html, or deploy a preview. Race feel is tuned in webapp/src/simulation.js (BIAS_SPREAD, RACE_VAR, SPEED_BASE, and the HORSES roster/odds).

Deploy

Push to master → the deploy-vercel GitHub Action runs vercel deploy --prod (requires the VERCEL_TOKEN repo secret). The api/ functions are deployed alongside the static app.

Notes

  • Coin balance is currently client-side (localStorage); the leaderboard API returns mock data. Real persistence needs a database.
  • Win rates are tuned to match the priced odds (≈30% house edge).

About

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages