A tiny Godot 4.6 toy: a slithery top-down snake you drive around the screen.
This whole project was built by godot-ai — an MCP server that lets an AI agent drive the Godot editor directly. Every node, script, and input action here was authored through MCP tool calls; no human hands on the editor.
Everything you see is drawn procedurally from code. The head, the eyes, the tapered body segments, even the grassy backdrop are all _draw() calls with circles and arcs. No sprites, no textures, no art assets — just math.
make me little snake guy
That's it. One line. The agent figured out the rest: a Node2D root, a physics loop, rotate_toward for smooth head turning, and a lerp-based chain for the slithery trail.
| Action | Keys |
|---|---|
| Up | W / ↑ |
| Down | S / ↓ |
| Left | A / ← |
| Right | D / → |
The head smoothly rotates toward the input direction; body segments ease into place behind it. The snake is soft-clamped to the viewport.
- Open Godot 4.6 (or newer).
- Import this folder as a project.
- Press F5 (or the ▶ button). The main scene is
scenes/snake.tscn.
scenes/snake.tscn— the scene (oneNode2Dwith the script attached).scripts/snake.gd— all the behavior: builds the snake in_ready, drives it in_physics_process.project.godot— project config + the foursnake_*input actions.
Exported vars on the root Snake node let you tweak it live:
segment_count— how long the body is.head_radius,segment_radius,segment_spacing— size and tightness.move_speed— head travel speed (pixels/sec).turn_speed— how quickly the head rotates toward the input direction (radians/sec).follow_smoothing— higher is a stiffer chain, lower is loose and wiggly.
