Home › GameMaker › GameMaker GML AGENTS.md

GameMaker GML AGENTS.md

AGENTS.md for GameMaker (2024+ runtime) projects in GML: objects and events, structs and methods, and clean state.

AGENTS.mdGameMaker

How to use

Save this as AGENTS.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.

AGENTS.mdDownload  
# AGENTS.md: GameMaker (GML)

## Basics
- Code lives in object events (`Create`, `Step`, `Draw`, `Draw GUI`, `Clean Up`) and script assets. Script assets define functions and constructors; they don't run per-frame logic at the top level.
- Use modern GML: structs, constructors (`function Inventory() constructor { ... }`), methods, `static` functions, and `array_*`/`struct_*` built-ins. Avoid `ds_*` structures unless needed for performance, and destroy any you create in `Clean Up`.
- Declare instance variables in `Create`; use `var` for locals. Never rely on undefined variables. Use `#macro` and `enum` for constants.

## Game loop
- Movement in `Step` uses `delta_time / 1000000` if the game is not locked to a fixed room speed, otherwise consistent per-step values. Pick one approach project-wide.
- State machines with an `enum` + `switch` or struct-based states, not piles of booleans.
- Collisions with `place_meeting`/`instance_place` and tilemap collision (`tilemap_get_at_pixel`) for terrain.
- UI drawing in `Draw GUI`; the world in `Draw`. Reset `draw_set_*` state (color, alpha, font, align) after you change it.

## Assets and data
- Name assets with prefixes: `obj_`, `spr_`, `snd_`, `rm_`, `scr_`, `fnt_`.
- Save data via `json_stringify(struct)` to a file with `buffer_save` or `file_text_*`, with a version field.

## Don't
- Don't edit `.yy`/`.yyp` project files by hand; describe IDE steps.
- Don't use `with(all)` or `instance_find` loops every step for lookups; keep references.

More: all GameMaker rules · all AGENTS.md rules

Related rules

Bevy game engine AGENTS.md

AGENTS.md for Bevy (0.16+) games in Rust: ECS systems, plugins, required components, and fast dev builds.

AGENTS.mdBevy (Rust)

Defold game engine AGENTS.md

AGENTS.md for Defold games in Lua: game objects and components, message passing, script lifecycle, and native extensions.

AGENTS.mdDefold

Godot 4 GDScript AGENTS.md

AGENTS.md for Godot 4 projects using typed GDScript, signals and scene composition.

AGENTS.mdGodot

MonoGame AGENTS.md

AGENTS.md for 2D/3D games in C# with MonoGame 3.8: game loop, content pipeline, scenes, and allocation-free updates.

AGENTS.mdMonoGame

Pygame (pygame-ce) AGENTS.md

AGENTS.md for 2D games in Python with pygame-ce 2.5+: game loop, scenes, sprites, assets, and testable logic.

AGENTS.mdPygame

Phaser 3 browser game rules

Windsurf rules for 2D browser games with Phaser 3, TypeScript and Vite.

WindsurfPhaser (web games)

Get new rules weekly

One email a week: fresh rule files, agent tips, and what's changing in Cursor, Claude Code and Copilot. Free, unsubscribe anytime.

Opens the Rulestack Newsletter on beehiiv in a new tab. Or subscribe directly on beehiiv.