Shiny Gen / Blog

How to make a 2D platformer in Godot with AI

Also in: Español · Deutsch · Français · Português · Italiano · Nederlands · Svenska · Norsk · Bahasa Indonesia · Türkçe · Polski · Tiếng Việt · Русский · 日本語 · 한국어 · 繁體中文

To make a 2D platformer in Godot with AI, open Shiny Gen, start a new game on the Godot Engine, and describe the platformer in the Agent tab: the hero, how running and jumping should feel, the levels, what to collect and avoid, the controls and the look. The AI agent builds it in GDScript, draws the art, plays it and fixes what it finds. We did that for this guide. Six messages gave Frog Hop Forest: a green frog hopping through three forest levels, with running that speeds up and slows down, a jump that goes higher the longer you hold it, coyote time, a double jump from level 2, flies to collect, beetles to stomp, a moving platform and a checkpoint halfway through each level. It took about six and a half minutes of agent time and about 39 gems.

Frog Hop Forest in play: the green frog on a grassy ledge in a forest level, with a wooden platform above, flies hovering over the ground, green hills behind, and LIVES 2, FOREST and two hearts at the top.
Frog Hop Forest in play, with the flies to collect and a platform above the frog.

The test: six messages, one platformer

We started a new game on the Godot engine, typed one detailed prompt, then said "continue" three times, asked for one change and said "continue" once more.

MessageWhat we typedAgent timeGems
1The prompt below3 min 49 s10
2"continue"20 s10.5
3"continue"7 s0.4
4"continue"2 s0.2
5A moving platform and checkpoints1 min 36 s12.3
6"continue"37 s5.5

That is about six and a half minutes of agent time and about 39 gems.

Why a platformer on the Godot engine

Shiny Gen's Godot Engine is its own build of Godot, and games are written in real GDScript. A platformer there is not limited to a retro screen: it fills a wide window, the background scrolls in layers, and the movement can be tuned in small steps. For a platformer on a retro console, see our Game Boy Color platformer test.

Step by step: the platformer we made

1. Start a Godot game

Press +, choose New, pick Custom for a game of your own, then pick Godot Engine on the Choose an engine screen. In a browser, this link opens a new Godot game directly. The Agent tab is where you talk to the AI.

2. Describe how it should feel

Name the movement you want in words: how running speeds up, how the jump works, and the small things that make a platformer feel fair. We typed:

Make a 2D platformer in Godot. A small green frog hops through a forest in three short levels. Give it real platformer physics: running that speeds up and slows down smoothly, a jump that goes higher the longer you hold the button, a moment of coyote time after walking off a ledge, and a double jump that you unlock in level 2. Collect flies for points, avoid spiky beetles (land on them from above to defeat them), and reach the lily pad flag at the end of each level. Arrow keys or A and D to move, Space to jump, and on a phone touch buttons on screen. Draw all the art yourself as code: the frog, the beetles, the flies, the ground and platforms, and a forest background in a few layers that scroll at different speeds. A title screen, a short card between levels, a win screen, sounds for jumping and collecting, and a cheerful tune. Keep the code clear GDScript with short comments.
The first prompt typed into the Agent tab of a new Godot game in Shiny Gen.
The first prompt, in the Agent tab.

3. The first message: three levels, played through

In this session the agent did not write the platformer line by line. The game's code file says it was generated from a short list of settings (levels, hero, run speed, jump strength, coyote time and so on), and the agent's work was to change those settings, draw the frog, the flies and the beetles as pixel art, and edit the code where the settings could not say what we asked: it moved the double jump so it unlocks in level 2. Then it played all three levels with its own test player and checked that level 1 has no double jump; it did not report trying the double jump in level 2. It reported:

In a full automated run through all three levels, the frog reached the lily pad flag at the end of each one, collected flies for points, and finished with no errors and all three lives.
Frog Hop Forest while the agent plays a round: the frog mid-hop collecting flies with +1 popping up, a wooden platform behind it, white spikes on the ground, and LIVES 3 at the top.
The agent's own play-test, collecting flies.

4. "continue": the controls you have to check

With the first "continue", the agent looked at the game in play and said what it could not test: the on-screen stick and jump button for phones. The next two "continue" messages added nothing: it said the game was finished and asked us to check the touch controls on a phone.

5. Ask for the next change

Add a moving platform and a checkpoint flag halfway through each level, so falling sends you back to the checkpoint.

The agent turned on moving platforms and checkpoints, then tested a fall just past the checkpoint in level 1: lives went from 3 to 2 and the frog came back at the halfway flag. The moving platform it could not confirm. In its last message:

The agent's last message: not tested, riding the moving plank and the on-screen stick and jump buttons on a phone; then how to play, with Worked for 37s, 5.5 gems.
The agent says what it did not test.

6. Play it, read the code, share it

Press Play to play it, or open the Code view to read the GDScript. Press Share to send a link. Exporting a game as a file is included with any purchase: the starter pack, any gem pack or a membership. For a Godot game the file is a web export, a zip you can host anywhere; the code runs on Shiny Gen's build of Godot, so stock desktop Godot cannot open it as a project.

The GDScript behind the jump

This is the jump from the game's own code, unchanged. COYOTE = 6 frames of grace after walking off a ledge and JBUF = 7 frames of jump buffering are two of the settings at the top of the file. keys & 4 is the jump button.

# a jump press is remembered for a few frames (the jump buffer)
if ((pf_jbuf > 0) and ((pf_on_ground != 0) or (pf_coyote > 0))):
    pf_vy = pf_jump_v
    pf_on_ground = 0
    pf_coyote = 0
    pf_jbuf = 0
...
pf_vy = cl_s16((pf_vy + 1))
if (((keys & 4) == 0) and (pf_vy < 0)):
    pf_vy = cl_s16((pf_vy + 2))
...
if (pf_on_ground != 0):
    pf_coyote = pf_coyote_n
    pf_air_jumps = 1
else:
    if (pf_coyote > 0):
        pf_coyote = (((pf_coyote - 1)) & 255)

Reading it: the frog can jump while it is on the ground or while the coyote counter is above zero; every frame it falls a little faster; and if you let go of the button while it is still rising, it is pulled down three times as fast, which is what makes a short tap a short hop. Standing on the ground refills the coyote counter, and walking off a ledge counts it down.

The code in this session was generated, so it reads more like a machine's than a tutorial's, and it did not keep our request for clear code with short comments: some comments still describe a fox and fruit. The comment on the first line of the excerpt is ours.

What we learned from the test

What to put in a platformer prompt

Ideas to ask for next

FAQ

Can AI make a platformer in Godot?

Yes. Describe the hero, the movement and the levels, and Shiny Gen's agent builds it in GDScript, draws the art and plays every level. Ours took six messages, about six and a half minutes of agent time and about 39 gems.

Do I need to know GDScript?

No. You describe the game and the agent writes and tests the code. You can read and edit it in the Code view, and editing it by hand costs nothing.

What are coyote time and a jump buffer?

Coyote time lets you still jump for a moment after walking off a ledge. A jump buffer remembers a jump pressed just before landing. In Frog Hop Forest they are 6 and 7 frames.

Can I open the project in desktop Godot?

No. The code is real GDScript you can read and copy, but it runs on Shiny Gen's own build of Godot, so stock desktop Godot cannot open it as a project. You can export the game for the web; exporting is included with any purchase.

Is it free?

Making, playing and sharing games is free. The built-in agent uses gems, and new accounts get free gems. Exporting a game as a file is included with any purchase. See the pricing page.

Shiny Gen is not affiliated with or endorsed by the Godot Foundation. Godot is a trademark of the Godot Foundation. It is named here only to describe.

Last updated: December 2, 2026

Start makingDownload on the App StoreGet it on Google Play