Guides

An AI can build and play your Godot game. The last look is still yours.

We described a small top-down game in Flockbay and let its AI build it in Godot 4, then sent two follow-up messages. This page is what the AI did inside the project at each step: what it read, what it wrote, how it ran and played the game, and what its reports left out.

What we asked
“A top-down 2D game where you are a bee in a meadow. Fly to flowers to collect pollen and carry it back to the hive. Wasps patrol the meadow, and a wasp that touches you knocks the pollen you are carrying to the ground. Bring 20 pollen home before sunset to win.”
Built in
Flockbay 3.7.6 for Windows, with the chat on Flockbay’s own AI
Engine
Godot 4.7.2, a 2D project on the Forward+ renderer
Messages
The description, Go on the brief, and two follow-ups
Project
Named Hive Home; the brief named the game Meadowbound

The description became a brief, and no file changed until Go

In New project we chose 2D and a blank project, named it Hive Home, and pasted the description above into Describe the game. The AI read the empty project first: its settings, its files and its one empty scene, main.tscn. Then it wrote a brief, named the game Meadowbound, and changed nothing.

First playable, from the brief

Guide one bee with WASD or arrow keys around a single top-down meadow, land on flowers to collect pollen, and return it to the hive. Avoid patrolling wasps; a touch drops carried pollen where it lands. Bring 20 pollen to the hive before the sunset timer runs out to win, or restart quickly after time expires.

The brief also listed what would come after (flower patches with different amounts of pollen, obstacles, a victory flourish, a second patrol pattern) and what is out of this version. We pressed Go: build the first playable.

It builds through the editor’s own operations, and lists every one

The AI does not hand you a script to paste. It works on the project through tools, and the chat lists each call as it happens. The first build, in order:

From its report

Both scripts compiled cleanly. The 10-second headless check reported 0 errors and warnings; the forward check moved Bee 93.5 px upward in 0.53 seconds. I didn’t visually inspect or play through the full delivery loop in this first-build check.

The last sentence is the one to look for in any report like this. A clean compile and a bee that moves prove the game starts and answers the keys. They say nothing about how it reads on screen.

The first build kept the whole meadow inside one script

After the first build the scene tree held three nodes: Main, the Bee and its collision shape. Everything else lived in main.gd, 266 lines long, as lists that the script drew itself every frame in _draw(): nine flowers with five pollen each, three wasp routes, the hive, the HUD and the end card.

scripts/main.gd, first build (excerpt)
var flower_positions: Array[Vector2] = []
var flower_pollen: Array[int] = []
var loose_pollen: Array[Vector2] = []
var wasp_paths: Array[Array] = []
var wasp_positions: Array[Vector2] = []
Meadowbound’s first build: a green meadow with nine flowers, a hive at the lower left and four small striped yellow and black insects, one of them the player’s bee on a white flower, under a dark green HUD reading Pollen home 00 / 20 and Carrying 05.
The first build, carrying five pollen. The bee is on the white flower at the left; the other three striped bodies are wasps.

It ran, and for a first prototype it is a reasonable way to write one. But in Godot’s editor there was nothing to select, no flower to drag and no route to reshape. And when we played it, the bee was hard to tell from the wasps.

One message turned the drawing into nodes you can move

The first follow-up, as we sent it:

Our message

I played it. The bee and the wasps look almost the same, so I lose track of which one is me. I’d also like to move the flowers, the hive and the wasp routes around myself in Godot’s editor. Can each of them be its own node in the scene instead of being drawn by one script?

Its first reply agreed that “both bee and wasps read as tiny yellow-and-black bodies.” It drew the bee larger, with cyan wings and an outline, made the wasps smaller, darker and angular, and rebuilt the meadow as nodes:

scenes/main.tscn after the first follow-up (outline)
Main (Node2D)
  Flowers
    FlowerPatch01 … FlowerPatch09
  WaspRoutes
    Route01
      Waypoint01 … Waypoint03
      Wasp
    Route02, Route03: the same
  Hive
  Bee (CharacterBody2D)
    CollisionShape2D

Each flower patch is a Node2D with the same flower_patch.gd, its own Position and its own pollen capacity in the Inspector. Each route holds its waypoints, which are Marker2D nodes, and a wasp that runs wasp.gd and patrols between them. A Marker2D is a node that holds a position and shows a handle you can drag in the 2D view, and nothing else. The hive and the bee have their own scripts too, and main.gd keeps the rules: pickups, deliveries, wasp hits and the clock.

The scripts now run in the editor too

The wasp’s script finds its route by collecting the Marker2D nodes beside it when the game starts. Its first line, @tool, makes the script run inside the editor as well. There Engine.is_editor_hint() is true, so the script only draws and skips the patrol:

scripts/wasp.gd (excerpt)
@tool
extends Node2D

func _ready() -> void:
	if Engine.is_editor_hint():
		queue_redraw()
		return
	add_to_group("wasps")
	for child in get_parent().get_children():
		if child is Marker2D:
			waypoints.append(child as Marker2D)
	reset_patrol()
Godot’s 2D view of the scene on the editor’s grey canvas: nine flower patches, the hive at the lower left, and three wasps, each at the start of a red route line between small waypoint markers, with the HUD text stacked at the top left.
The scene in Godot’s 2D view after the first follow-up. The red lines are the wasp routes; drag a waypoint and that patrol follows it. The HUD text piled at the top left is how this editor preview draws it, and the bee waits at the scene’s origin until a round places it by the hive.

Its checks this time: all six scripts compile, a five-second headless run with no errors or warnings, and an input test in which the bee “collected 3 pollen and delivered 3”.

Meadowbound after the first follow-up: the bee, outlined in bright cyan, on a flower patch near the hive, and three wasps, smaller, darker and angular, spread over the meadow.
The meadow after the first follow-up, carrying five pollen. The bee is the one outlined in cyan.

Asked to play it through, it played with the same keys you would

The second follow-up:

Our message

Much easier to see now. Before I play it myself: can you play the whole thing through and tell me what happens? Collect pollen, get hit by a wasp and pick the dropped pollen back up, then bring 20 home and make sure the win screen shows.

It started the game with Play and steered the bee with the game’s own input actions, the same move_forward and move_right that your keys press, while reading the game’s variables back ten times a second. These are its readings around the wasp hit:

Time (ms)CarryingPollen on the ground
1,34650
1,44005
1,94214
2,03623
2,13032
2,22541
2,34050

At 1,440 ms a wasp touched the bee: all five pollen dropped into the grass. The bee flew over them and had all five back 900 ms later. That is the rule the brief asked for, checked as numbers rather than judged from a picture.

The game kept running while the AI was thinking

That first run ended at sunset with 10 of 20 pollen home. The game was not too hard: it runs in real time, and the AI reads scripts and plans between its moves. Its first key press came 29.75 seconds into the day.

So it restarted and sent the whole route as one input: fly to a flower, wait until the count rises, fly home, then on to the next. Its report:

From its report

I restarted and completed the delivery: the live game state read delivered_pollen = 20, won = true, with 90.3 seconds left. The screenshot showed POLLEN DELIVERED!

Read the numbers the way a designer would. On that route the win came with 90.3 of 100 seconds of daylight left, so the sunset never pressed it. Daylight is one of the three values in Tune, and it is a change to make once you have played it yourself.

What it missed was in the picture it took

The screenshot did show the win card, with a flower patch drawn across the middle of its first word:

Meadowbound’s win screen: a dark overlay with POLLEN DELIVERED!, The hive is ready for night and Press R to fly again, while the flower patches and wasps stay bright on top of the overlay, one pink patch over the word POLLEN.
The frame the AI looked at when it reported the win. The flowers and wasps draw over the end card.

Godot draws a node’s children after the node itself. In the first build the end card came last in main.gd’s own _draw(), so it covered the meadow. Once the flowers and wasps became nodes under Main, they draw after it, over the end card that Main draws. The usual fix in Godot is to put the HUD and the end card on a CanvasLayer, which draws above the 2D scene whatever the order of the nodes. That is what to ask for in the next message.

The report was true and the picture was in front of it, and only looking at the picture caught the problem. That is the habit to keep when you build in Godot with an AI: let it run the checks, then play it and look before you build on top.

Try it with your own game

Download Flockbay, choose New project, and describe your game in Describe the game. Getting started covers the first session.

More guides