A best-in-class TypeScript boilerplate for shipping high-quality 2D HTML5 games ā built on PixiJS, Rapier physics, Howler audio, and tween.js ā so you can build at the speed of thought with AI, ship a polished game, and rank #1 on Google.
ā” Demo: 2d-game-base.gallop.software
šØ Template: gallop.software/templates
š¦ Repository: github.com/gallop-software/2d-game-base-pro
š·ļø Category: 2D Game Boilerplate
Just chat with AI inside your code editor using our Gallop templates, and you will never want to wrestle with a 3D engine, a heavyweight game framework, or a bloated visual editor again. Simply describe the game you want, and AI writes the code. No Unity, no GameMaker, no level editors, and no design limitations. Just type and watch. Build fun and crisp gameplay, add smooth physics-driven animations, configure your SEO and AI discoverability instantly, expand endlessly, and get prompting tips from our Gallop community. Go live in minutes.
core/, scenes/, systems/, objects/, ui/ separationVideoGame schemastrict: trueNew to this? No problem. You'll have AI guiding you the entire way. Choose your editor below and follow the steps.
We recommend the Gallop AI Editor for the best experience with Gallop templates ā whether you're a beginner or an advanced game developer who wants AI-assisted iteration. It was purpose-built for this workflow and requires zero configuration. VS Code is also a fine choice if you prefer to work without AI assistance.
| Gallop AI Editor | VS Code | |
|---|---|---|
| Best for | Non-programmers, junior programmers, advanced programmers | Advanced programmers |
| AI built in | Yes ā Claude AI ready to go | No (optional extensions available) |
| AI setup requirement | Enter Claude API keys | Install extensions manually |
| Template browser | Built-in marketplace | Download ZIP from GitHub |
| Media manager | Built-in Studio with CDN sync | Manual file management |
| Font manager | Built-in Studio with WOFF2 font generation | No support |
| SEO Audit | Analyze SEO & Structured Data | No support |
| Git | Better Git UI with modal diff viewer | Default Git UI |
| Node.js | Built-in installer and version manager | Install Node.js separately |
The Gallop AI Editor is a desktop app built specifically for AI-powered web development. It includes everything you need ā code editor, AI assistant, Git, terminal, media manager, font manager, SEO & structured data scanner, and a template marketplace ā all in one window with nothing to configure.
Available for Mac and Windows.
From the built-in template marketplace:
Or from a ZIP download:
2d-game-base folderClick the AI Chat panel (or press Cmd+E on Mac / Ctrl+E on Windows) to open the AI assistant. Now just ask:
I'm new to this. Help me turn this template into my own 2D game.
The AI assistant can read and edit your project files, run commands, and explain anything you're confused about. Just describe what you want in plain English:
Replace the placeholder with a side-scrolling platformer
Add jump physics with a double-jump unlock
Make the player sprite a pixel-art knight
Wire up a game-over screen with a high-score table
Tip: Press Cmd+Ctrl+3 (Mac) to take a screenshot of your running game and attach it to the chat. The AI can see exactly what you see and suggest changes visually.
VS Code is a good choice if you prefer to work without AI assistance. You'll need to install a few things manually.
Click the green Code button at the top of this GitHub page, then click Download ZIP. Unzip the folder somewhere easy to find (like your Desktop).
2d-game-base folderOpen the terminal in VS Code (Ctrl+` on Mac/Windows) and run:
npm installnpm run dev
Open http://localhost:5173 to see your game. Press Ctrl+C to stop the server.
Edit files directly in VS Code. Refer to the Project Structure and Available Scripts sections below for guidance.
Connect with other Gallop users on Slack. Share your progress, swap AI prompting tips, and see what indie devs are shipping with the help of AI.
When you're ready to share your game with the world, you'll need a free GitHub account to store your code and a free Vercel account to host your build.
Just ask your AI assistant:
Help me create a GitHub account, push this project to GitHub, and deploy to Vercel
The AI will walk you through every step. When you're done, your game will be live with a URL you can share.
If you're comfortable with Git:
Ask your AI assistant:
Help me clone my new GitHub repository and run it locally
Or run these commands in your terminal:
git clone https://github.com/YOUR-USERNAME/YOUR-REPO-NAME.gitcd YOUR-REPO-NAMEnpm installnpm run dev
Open http://localhost:5173 to view your game. Press Ctrl+C to stop the server. When ready to test the production build, run npm run build then npm run preview.
Select your repository, and Vercel will automatically deploy whenever you push changes.
Congratulations! Your game is now live to the world. Share your new URL and start growing your audience. Ready for a custom domain? See Vercel's domain setup guide.
2D Game Base is part of the Gallop template ecosystem. Gallop templates are designed to be built with AI ā just describe what you want in plain English and watch your project come to life.
The Gallop AI Editor is a desktop code editor built specifically for AI-powered development. It combines a full code editor, Claude AI assistant, visual Git interface, integrated terminal, media manager, and template marketplace into one app. Everything is preconfigured to work with Gallop templates out of the box ā no extensions, no plugins, no setup.
Key highlights:
Cmd+Ctrl+3 to screenshot your running game and share it with AI for visual feedbackThis template was crafted from the ground up to get your game ranked #1 on Google and recommended by AI assistants like ChatGPT and Google's Gemini. Canvas-rendered games are invisible to crawlers by default, so the HTML shell ships with semantic landmarks, complete metadata, Open Graph, Twitter cards, and a JSON-LD VideoGame schema block that search engines and AI models actually parse.
AI mentions are becoming more important than traditional SEO. When someone asks an AI assistant for "fun browser games like X," you want yours in that answer. Gallop templates are built with the structured data and semantic markup that AI models rely on to understand and recommend your work. Games using this template are already ranking on Google and getting discovered by AI assistants.
The team behind Gallop has decades of combined experience building websites, apps, and web applications for top global brands. We've helped projects achieve #1 Google rankings in competitive markets and understand what it takes to ship something polished. That expertise is baked into every template, every component and every line of code.
2d-game-base/āāā src/ā āāā main.ts # Async bootstrap: creates Game, switches to PreloadSceneā āāā constants.ts # COLORS, ASSETS, gameplay tunablesā āāā types.ts # Shared scene-data interfacesā āāā core/ # Engine glueā ā āāā Game.ts # PIXI app + systems + scene manager + frame loopā ā āāā Scene.ts # Abstract base extending PIXI.Containerā ā āāā SceneManager.ts # Active-scene management with safe transitionsā āāā systems/ # Reusable subsystemsā ā āāā InputManager.ts # Keyboard + pointer + onPress() helpersā ā āāā AudioManager.ts # Howler wrapperā ā āāā PhysicsWorld.ts # Rapier wrapper: bodies, sensors, collision eventsā ā āāā AssetManager.ts # PIXI.Assets wrapperā āāā scenes/ # Game flowā ā āāā PreloadScene.ts # Loads assets, shows progress, hands off to Menuā ā āāā MenuScene.ts # Title + Start buttonā ā āāā GameScene.ts # Placeholder mini-game (REPLACE THIS)ā ā āāā GameOverScene.ts # End screen + restartā āāā objects/ # Per-entity classes (Pixi display + Rapier body)ā ā āāā Player.tsā ā āāā Coin.tsā āāā ui/ # Persistent UI overlaysā ā āāā HUD.tsā āāā utils/ # Shared helpersā āāā math.ts # clamp, lerp, randRange, randIntāāā public/ā āāā screenshot.jpg # Featured image for OG / template marketplacesā āāā favicon.svg # Vector faviconā āāā manifest.webmanifest # PWA manifestā āāā robots.txt # Crawler directivesā āāā sitemap.xml # Sitemap (single URL by default)ā āāā assets/ # Game assetsā āāā sprites/ # Drop sprite sheets hereā āāā audio/ # Audio files (e.g. pickup.wav)ā āāā tilemaps/ # Tilemap JSON / imagesāāā _data/ā āāā _studio.json # Studio/image metadataāāā index.html # SEO-rich HTML shell + JSON-LD VideoGame schemaāāā vite.config.ts # Vite + vite-plugin-pwa configurationāāā tsconfig.json # TypeScript config (strict: true)āāā eslint.config / .eslintrc.cjsāāā .prettierrc.jsonāāā package.jsonāāā README.md
npm run dev ā Start development server at http://localhost:5173 with hot reloadnpm run build ā Type-check, then bundle to dist/ for productionnpm run preview ā Serve the production build locally for testingnpm run typecheck ā TypeScript type checking without emittingnpm run lint ā Run ESLint on all source filesnpm run format ā Format all source files with PrettierEvery dependency is battle-tested in production and chosen for stability, performance, and long-term maintainability.
8.5.1 ā WebGL/WebGPU 2D renderer with native high-DPI support0.14.0 ā Rust ā WASM physics engine (@dimforge/rapier2d-compat)2.2.4 ā Web Audio with HTML5 fallback, sprite slicing, master volume/mute25.0.0 ā Lightweight animation library (@tweenjs/tween.js)Tools for building and developing the game:
5.4 ā Dev server and bundler with instant HMR0.20.1 ā Service worker + manifest generation5.5 ā Type safety and IntelliSense (strict: true)8.57 ā Code linting (with @typescript-eslint)3.3 ā Code formatting2.2.11 ā TypeScript types for HowlerMIT License ā see LICENSE for details
Contributors:
Built with ā¤ļø by the team at Gallop