vchelaru/flatredball2/grid-movement
Claude Code and agent skill by vchelaru/flatredball2
- community
Checking that the SKILL.md file is still in the repository.
Grid Movement in FlatRedBall2. Use when implementing tile-by-tile (grid-snapped) movement where one key press = one tile step, input is locked during the movement animation, and the player cannot move into blocked tiles. Trigger on any dungeon-crawler, Pokémon-style, roguelike, or puzzle game with discrete grid movement. Do NOT trigger for analog/free top-down movement — use the top-down-movement skill for that.
Install
npx vskill@latest install vchelaru/flatredball2/grid-movementSKILL.md
Grid Movement in FlatRedBall2
Not `TopDownBehavior` —TopDownBehaviorproduces continuous analog velocity-based movement. For tile-by-tile grid movement, implement the pattern below directly. Do not load thetop-down-movementskill for this use case.
Grid movement has three invariants:
- The entity always sits on a tile boundary (position snapped to multiples of
TileSize). - Input is locked while a move is in progress.
- A pre-move collision check prevents entering blocked tiles.
Minimal Implementation
Pre-Move Collision Check
Use TileShapes.GetTileAtWorld(x, y) to test the target tile before committing:
TileShapes is injected from the screen after spawning via a method on the entity. See the levels skill for how to generate it from a TMX layer.
Namespace gotcha —TileShapeslives inFlatRedBall2.Collision, notFlatRedBall2.Tiled. Addusing FlatRedBall2.Collision;to any file that declares aTileShapesfield.
Tween Helper
A lerp tween using Engine.Time.CurrentScreenTime (accessible from any entity via Engine):
`CancellationToken` scope —Tokenis a property ofScreen, notEntity. PassCancellationToken.Nonefrom an entity. For tweens this short (<200 ms) that is safe; if you need cancellation on screen exit, thread a token in via a constructor parameter.
Gotchas
- Always snap on spawn — entities loaded from a TMX object layer may have sub-pixel offsets. Round
XandYto the nearest tile inCustomInitialize. - `_moving` guard is required — without it, holding a key queues multiple moves before the first frame completes.
- Diagonal movement: If 8-way is needed, check that both axis tiles are clear before committing. Diagonal into a corner with one axis blocked should push to the open axis or reject.
- Entity origin and draw order: if entities need screen-depth sorting (walking behind/in front of scenery),
(X,Y)should be the ground-contact point andZ = -Yeach frame — seetop-down-movement's Entity Origin and Draw Order section.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingfrb-skills/grid-movement/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/vchelaru/flatredball2/grid-movement)