Skip to content

Latest commit

 

History

History
50 lines (32 loc) · 2 KB

File metadata and controls

50 lines (32 loc) · 2 KB

Snake Guy

Snake Guy in action

A tiny Godot 4.6 toy: a slithery top-down snake you drive around the screen.

How it was made

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.

The v1 prompt

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.

Controls

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.

Running it

  1. Open Godot 4.6 (or newer).
  2. Import this folder as a project.
  3. Press F5 (or the ▶ button). The main scene is scenes/snake.tscn.

Files

  • scenes/snake.tscn — the scene (one Node2D with the script attached).
  • scripts/snake.gd — all the behavior: builds the snake in _ready, drives it in _physics_process.
  • project.godot — project config + the four snake_* input actions.

Tuning

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.