PluginBench
Skill
Official
Pass
Audit score 90

game-engine

github/awesome-copilot

Build web-based games and game engines with HTML5 Canvas, WebGL, and JavaScript.

What is game-engine?

Expert skill for creating 2D and 3D web games using Canvas, WebGL, and JavaScript frameworks. Use this when building game engines, implementing physics and collision detection, handling game loops, managing sprites, or adding game controls. Covers platformers, breakout games, maze games, tilemaps, audio, multiplayer via WebRTC, and game publishing.

  • Implement game loops with input processing, state updates, and rendering
  • Build 2D games with Canvas 2D rendering and sprite management
  • Create 3D games using Three.js, Babylon.js, A-Frame, or PlayCanvas
  • Handle collision detection (AABB, circle, SAT, raycasting)
  • Implement physics including velocity, acceleration, and gravity
  • Support multiple control schemes: keyboard, mouse, touch, and gamepad

How to install game-engine

npx skills add https://github.com/github/awesome-copilot --skill game-engine
Prerequisites
  • Basic knowledge of HTML, CSS, and JavaScript
  • A modern web browser with Canvas/WebGL support
  • A text editor or IDE
  • Optional: Node.js for build tooling and local development servers
Claude Code
Cursor
Windsurf
Cline

How to use game-engine

  1. 1.Set up an HTML file with a canvas element and get the 2D or 3D rendering context
  2. 2.Implement the game loop using requestAnimationFrame for input, update, and render phases
  3. 3.Create game objects with position, velocity, and size properties
  4. 4.Add collision detection between game objects using appropriate algorithms
  5. 5.Implement player controls via keyboard, mouse, touch, or gamepad input
  6. 6.Add physics simulation for movement, gravity, and interactions
  7. 7.Integrate audio using Web Audio API or HTML5 audio elements
  8. 8.Test across browsers and devices, then optimize and publish

Use cases

Good for
  • Building a breakout-style paddle game with scoring and collision physics
  • Creating a 2D platformer with tilemaps, sprites, and gravity-based movement
  • Developing a 3D first-person game with WebGL and camera controls
  • Adding touch controls and device orientation input to mobile games
  • Implementing multiplayer features using WebRTC or WebSockets
Who it's for
  • Game developers building web-based games
  • Full-stack developers adding interactive game features to applications
  • Educators teaching game development concepts
  • Indie developers publishing games to web platforms

game-engine FAQ

What rendering approach should I use for my game?

Use Canvas 2D for 2D games and sprite-based rendering. Use WebGL (via Three.js, Babylon.js, or A-Frame) for 3D games or advanced 2D rendering. SVG works for vector graphics and UI elements.

How do I prevent my game from running at different speeds?

Use delta time in your update calculations instead of fixed movement values. This ensures consistent gameplay across different frame rates.

Why doesn't audio play in my game?

Browsers require user interaction before playing audio. Trigger audio playback from a click or touch handler rather than automatically on page load.

How do I handle collision detection for fast-moving objects?

Use continuous collision detection or reduce time steps for physics updates. Fast-moving objects can pass through colliders if checked only at discrete frames.

What should I do if my game performance is poor?

Profile with browser developer tools, reduce draw calls, use object pooling for frequently created objects, and optimize asset sizes (compress images and minify code).

Full instructions (SKILL.md)

Source of truth, from github/awesome-copilot.


name: game-engine description: 'Expert skill for building web-based game engines and games using HTML5, Canvas, WebGL, and JavaScript. Use when asked to create games, build game engines, implement game physics, handle collision detection, set up game loops, manage sprites, add game controls, or work with 2D/3D rendering. Covers techniques for platformers, breakout-style games, maze games, tilemaps, audio, multiplayer via WebRTC, and publishing games.'

Game Engine Skill

Build web-based games and game engines using HTML5 Canvas, WebGL, and JavaScript. This skill includes starter templates, reference documentation, and step-by-step workflows for 2D and 3D game development with frameworks such as Phaser, Three.js, Babylon.js, and A-Frame.

When to Use This Skill

  • Building a game engine or game from scratch using web technologies
  • Implementing game loops, physics, collision detection, or rendering
  • Working with HTML5 Canvas, WebGL, or SVG for game graphics
  • Adding game controls (keyboard, mouse, touch, gamepad)
  • Creating 2D platformers, breakout-style games, maze games, or 3D experiences
  • Working with tilemaps, sprites, or animations
  • Adding audio to web games
  • Implementing multiplayer features with WebRTC or WebSockets
  • Optimizing game performance
  • Publishing and distributing web games

Prerequisites

  • Basic knowledge of HTML, CSS, and JavaScript
  • A modern web browser with Canvas/WebGL support
  • A text editor or IDE
  • Optional: Node.js for build tooling and local development servers

Core Concepts

The following concepts form the foundation of every web-based game engine.

Game Loop

Every game engine revolves around the game loop -- a continuous cycle of:

  1. Process Input - Read keyboard, mouse, touch, or gamepad input
  2. Update State - Update game object positions, physics, AI, and logic
  3. Render - Draw the current game state to the screen

Use requestAnimationFrame for smooth, browser-optimized rendering.

Rendering

  • Canvas 2D - Best for 2D games, sprite-based rendering, and tilemaps
  • WebGL - Hardware-accelerated 3D and advanced 2D rendering
  • SVG - Vector-based graphics, good for UI elements
  • CSS - Useful for DOM-based game elements and transitions

Physics and Collision Detection

  • 2D Collision Detection - AABB, circle, and SAT-based collision
  • 3D Collision Detection - Bounding box, bounding sphere, and raycasting
  • Velocity and Acceleration - Basic Newtonian physics for movement
  • Gravity - Constant downward acceleration for platformers

Controls

  • Keyboard - Arrow keys, WASD, and custom key bindings
  • Mouse - Click, move, and pointer lock for FPS-style controls
  • Touch - Mobile touch events and virtual joysticks
  • Gamepad - Gamepad API for controller support

Audio

  • Web Audio API - Programmatic sound generation and spatial audio
  • HTML5 Audio - Simple audio playback for music and sound effects

Step-by-Step Workflows

Creating a Basic 2D Game

  1. Set up an HTML file with a <canvas> element
  2. Get the 2D rendering context
  3. Implement the game loop using requestAnimationFrame
  4. Create game objects with position, velocity, and size properties
  5. Handle keyboard/mouse input for player control
  6. Implement collision detection between game objects
  7. Add scoring, lives, and win/lose conditions
  8. Add sound effects and music

Building a 3D Game

  1. Choose a framework (Three.js, Babylon.js, A-Frame, or PlayCanvas)
  2. Set up the scene, camera, and renderer
  3. Load or create 3D models and textures
  4. Implement lighting and shaders
  5. Add physics and collision detection
  6. Implement player controls and camera movement
  7. Add audio and visual effects

Publishing a Game

  1. Optimize assets (compress images, minify code)
  2. Test across browsers and devices
  3. Choose distribution platform (web, app stores, game portals)
  4. Implement monetization if needed
  5. Promote through game communities and social media

Game Templates

Starter templates are available in the assets/ folder. Each template provides a complete, working example that can be used as a starting point for a new project.

TemplateDescription
paddle-game-template.md2D Breakout-style game with pure JavaScript
2d-maze-game.mdMaze game with device orientation controls
2d-platform-game.mdPlatformer game using Phaser framework
gameBase-template-repo.mdGame base template repository structure
simple-2d-engine.mdSimple 2D platformer engine with collisions

Reference Documentation

Detailed reference material is available in the references/ folder. Consult these files for in-depth coverage of specific topics.

ReferenceTopics Covered
basics.mdGame development introduction and anatomy
web-apis.mdCanvas, WebGL, Web Audio, Gamepad, and other web APIs
techniques.mdCollision detection, tilemaps, async scripts, audio
3d-web-games.md3D theory, frameworks, shaders, WebXR
game-control-mechanisms.mdTouch, keyboard, mouse, and gamepad controls
game-publishing.mdDistribution, promotion, and monetization
algorithms.mdRaycasting, collision, physics, vector math
terminology.mdGame development glossary
game-engine-core-principles.mdCore design principles for game engines

Troubleshooting

IssueSolution
Canvas is blankCheck that you are calling drawing methods after getting the context and inside the game loop
Game runs at different speedsUse delta time in update calculations instead of fixed values
Collision detection is inconsistentUse continuous collision detection or reduce time steps for fast-moving objects
Audio does not playBrowsers require user interaction before playing audio; trigger playback from a click handler
Performance is poorProfile with browser dev tools, reduce draw calls, use object pooling, and optimize asset sizes
Touch controls are unresponsivePrevent default touch behavior and handle touch events separately from mouse events
WebGL context lostHandle the webglcontextlost event and restore state on webglcontextrestored