AgentSkillsCN

build-game

使用 Mac 的 Makefile 构建 Asciicker 游戏可执行文件。当需要构建游戏、在修改后重新编译,或应用户要求构建/编译游戏时,可使用此功能。

SKILL.md
--- frontmatter
name: build-game
description: Build the Asciicker game executable using the Mac makefile. Use when building the game, recompiling after changes, or when the user asks to build or compile the game.
allowed-tools: Bash, Read

Build Game Skill

Builds the Asciicker game executable for macOS using the project's makefile.

Quick Commands

Build the game:

bash
make -f makefile_game_mac

Clean build (rebuild everything):

bash
make -f makefile_game_mac clean && make -f makefile_game_mac

Build for Linux:

bash
make -f makefile_game

Build Output

The compiled game will be at: .run/game

Launch After Build

To run the game after building:

bash
./.run/game

Or on macOS (to launch as app):

bash
open .run/game.app

What Gets Built

The game includes:

  • Player movement and controls
  • Terrain rendering (grass, water, etc.)
  • Enemy AI and spawning
  • Physics system
  • Inventory system
  • Terminal rendering mode (optional)

Common Build Issues

  1. Missing dependencies: Ensure SDL2, OpenGL, pulse audio libraries installed
  2. Linking errors: Check that all game-specific modules compiled
  3. Terminal mode: Game can run in terminal or OpenGL mode

Files Compiled

Main sources:

  • game_app.cpp - Main game logic and initialization
  • game.cpp - Game state and logic
  • terrain.cpp - Terrain rendering
  • physics.cpp - Physics simulation
  • enemygen.cpp - Enemy generation
  • inventory.cpp - Inventory system
  • Plus rendering and audio dependencies

Instructions

When the user asks to build the game:

  1. Run make -f makefile_game_mac
  2. Report any compilation warnings or errors
  3. Confirm successful build with "Linking: .run/game"
  4. Optionally launch the game if requested