Chuyển đến nội dung
Skillpedia
Lập trình chung40k · #7214

game-engine

Skill này làm gì

Công cụ này giúp bạn xây dựng game chạy trên web bằng các công nghệ như HTML5, Canvas và JavaScript. Nó cung cấp mẫu và hướng dẫn để tạo mọi thứ, từ game 2D đơn giản đến trải nghiệm 3D.

Khi nào nên dùng

  • ✓Xây dựng một game từ đầu để chơi trên trình duyệt web.
  • ✓Thêm vật lý, điều khiển hoặc âm thanh vào một game hiện có.
  • ✓Phát triển một game engine để dùng lại cho nhiều dự án.

Liên kết skill

https://github.com/github/awesome-copilot/blob/main/skills/game-engine/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/github/awesome-copilot/blob/main/skills/game-engine/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Tạo một game platformer 2D đơn giản với điều khiển bằng bàn phím.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ dùng một chu trình liên tục gọi là “game loop” để cập nhật những gì xảy ra trong game (chuyển động, logic) rồi vẽ mọi thứ lên màn hình. Nó cũng giúp phát hiện khi các vật thể chạm nhau (va chạm) và phản hồi lệnh của người chơi.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

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.

Template Description
paddle-game-template.md 2D Breakout-style game with pure JavaScript
2d-maze-game.md Maze game with device orientation controls
2d-platform-game.md Platformer game using Phaser framework
gameBase-template-repo.md Game base template repository structure
simple-2d-engine.md Simple 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.

Reference Topics Covered
basics.md Game development introduction and anatomy

…

Câu hỏi thường gặp

Tôi có cần là lập trình viên chuyên nghiệp để dùng không?

Nên có kiến thức cơ bản về HTML, CSS và JavaScript, nhưng công cụ có các hướng dẫn để giúp bạn trong suốt quá trình.

Tôi có thể làm game 3D không?

Có. Công cụ hỗ trợ phát triển 3D bằng các công nghệ như WebGL và các framework như Three.js.

Người chơi tương tác với game bằng cách nào?

Bạn có thể thiết lập điều khiển bằng bàn phím, chuột, màn hình cảm ứng và thậm chí tay cầm chơi game.

Chi tiết

Mô tả gốc của tác giả

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,

repo: github/awesome-copilot

Độ phổ biến

Sao GitHub
40k
Vị trí xếp hạng
#7214
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự