top | item 47034752

Show HN: 2d platformer game built with Codex (zero code)

10 points| armcat | 13 days ago

Hi HN!

On Sunday I spent a couple of hours building a short 2d platformer ("Prince of Persia" style). What's interesting is how I built it. I went for a zero-code approach, and built the whole thing using OpenAI Codex CLI and agent skills (with the progressive disclosure paradigm).

You can play the game here: https://acatovic.github.io/gothicvania-codex-demo/

You can see the full code, agent skills and a complete writeup here: https://github.com/acatovic/gothicvania-codex-demo

Some takeaways:

* This was one of the most enjoyable experiences ever!

* Applying harness engineering with progressive disclosure is incredibly powerful - I treated my SKILL.md as simply a ToC (a "skills map") and took it from there

* Implement -> Evaluate loops are key - I used Playwright and an evaluation checklist and the agent built and corrected automagically

* I used PROGRESS.md as a memory/log mechanism for the agent, and a way to minimize context noise

* The game dev agent was steered by the DESIGN-DOCUMENT.md, stipulating game objectives, layout and mechanics

* I used progressive prompting - I built up the game piece wise - starting with basic player mechanics, then adding tiles, NPCs, interactions, sounds, menus - one prompt at a time

Zero code written by me. Never even looked at the game engine (Phaser) API - just gave the skills a link to the documentation. The future is here!

Credits to ansimuz (gothicvania assets) and Pascal Belisle (music).

*NOTE:* The assets were *NOT* created by AI. Backgrounds and probably tiles you could generate with AI, but sprites are not quite there yet (I tried a number of different models). Something to explore fully in the future.

Enjoy and let me know what you think!

10 comments

order

vunderba|13 days ago

Nice job. As far as graphics go, I've actually done some experimentation with attempting to build sprites aligned to a well defined grid using Gen AI. You can get surprisingly far by setting up an image of a cartesian grid where each cell can be thought of as a single pixel.

Once you down-sample using nearest neighbor all the lines disappear and you're left with more traditional pixel art 32x32 tiles.

https://mordenstar.com/other/nb-sprites

armcat|13 days ago

Sweet! Have you had any luck with motion based ones, such as a character walking or an action sequence? That's where I've had the most issues.

yuppiepuppie|13 days ago

This is very cool.

Out of curiosity, did you have any previous experience with game development to be able to actively critique the direction that the agent was developing towards?

Also, hope you dont mind, but I added it to the HN Arcade :) https://hnarcade.com/games/games/gothicvania

armcat|13 days ago

Thank you, and I don't mind at all!

I don't have any professional experience but I did build a pacman clone in Turbo Pascal (on MS DOS) back in the 90s. Also I've been playing games all my life so have a feeling for what's important - collision detection, walkable/collidable areas, speed/timing, some basic NPC logic etc. So that seemed to have been sufficient in this case :-)

Aristarkh|13 days ago

Using progressive disclosure with Codex is a fascinating way to handle complexity, but game physics are notoriously difficult to validate via text-based checklists. Since collision detection and movement can be subtle or visual, how did your Playwright setup distinguish between "working" mechanics and edge cases like glitching through walls? I'm curious if the Implement -> Evaluate loop ever got stuck cycling on a specific bug where the agent couldn't satisfy the test criteria without human intervention. Did you have to define specific tolerance thresholds for the physics engine to prevent false positives in the evaluation phase?

armcat|12 days ago

Incredibly I didn't do anything, I just told codex to use playwright cli, told it what to check (in plain English), and it did its thing. Looking at its log I can see that it was "playing" the game and defining its own test conditions, such as if the player/NPC is *not* on one of the "collidable" tiles, if the NPC is "going over the edge" of a collidable area, if it's facing the wrong way, etc. Sometimes it found bugs, e.g. it was testing for gravity checks and then it found that one of the movements was not working correctly and it went ahead and fixed it.

So essentially it uses CLI to read all the x,y coordinates, speed, timing, it took screenshots, and combined those together.

My learning from this is - just let the agent do it. Actually trying to interfere with specific conditions and checks lowers the agent's performance. Simply give it a guide.

andsoitis|13 days ago

Impressive. Higher resolution graphics would be super sexy.

armcat|13 days ago

I love old school platformers but definitely worth trying to replicate this process with a higher res game.