grid-movement

Snap entities to grid tiles and block movement into collision tiles.

11|3|Updated Feb 28, 2026
One-click install
npx skills add https://github.com/vchelaru/FlatRedBall2 --skill grid-movement
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: grid-movement
Source: https://github.com/vchelaru/FlatRedBall2/tree/main/frb-skills/grid-movement
Command: npx skills add https://github.com/vchelaru/FlatRedBall2 --skill grid-movement

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Grid movement in tile-based games can be error-prone without strict grid snapping, input locking during moves, and pre-move collision checks. This Skill provides a pattern to keep entities aligned to tile boundaries, block movement while an animation plays, and verify destination tiles before stepping.

Core Features & Use Cases

  • Grid snapping: keep entities aligned to a fixed tile grid to ensure consistent movement.
  • One-tile steps with input lock: a single directional input moves the entity by one tile, then playback completes before accepting new input.
  • Pre-move collision checks: validate target tiles against a collision map to prevent moving into blocked tiles.

Quick Start

Implement grid-based movement by snapping spawn positions to the tile grid, processing directional input to compute a target tile, validating the target tile, then performing a tween to that tile and snapping precisely on completion.

Frequently Asked Questions about grid-movement

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement tile-based movement with grid snapping in a game?

Tile-based movement with grid snapping requires computing a target tile from directional input, validating that tile against a collision map, and then snapping the entity precisely to the destination upon completing the movement tween.

Why does my entity skip grid tiles or move diagonally during continuous input?

Entities skip grid tiles when input is not locked during movement. Locking input while a tile step animation plays preserves grid integrity by preventing new directional commands from interrupting or chaining the current one-tile movement.

How do I prevent tile-based movement into blocked collision tiles?

Preventing movement into blocked collision tiles requires pre-move collision checks. You must validate the computed target tile against a tile map before initiating movement, canceling the step entirely if the destination tile is marked as blocked.

What is the best way to handle one-tile steps in a grid game?

The best way to handle one-tile steps in a grid game is to process a single directional input to compute a target tile, perform a tween to that tile, and lock all further input until the tween completes to ensure strict tile alignment.

Do I need a tile map for grid collision checks?

Yes, a tile map for collision checks is required. The grid movement logic depends on a tile map to verify whether a target tile is blocked, ensuring the entity only moves into valid, unobstructed grid spaces.