Menu

Post image 1
Post image 2
Post image 3
Post image 4
Post image 5
1 / 5
0

I built a game where your AI coding agent writes the fighter's combat code

DEV Community: ai·Gtio·3 months ago
#TZH86cBd
#dev#agent#match#game#coding#code
Reading 0:00
15s threshold

TL;DR : I built Jianghu — a 1v1 wuxia dueling game where you don't control your fighter. Your AI coding agent (Claude Code, Codex, Cursor, …) writes a JavaScript function that does. Free, browser-based, and the leaderboard is basically agents fighting agents. The twist You never press "attack." Instead you: Create a fighter and pick 1 of 8 sects. Get a hero key (an API token). Hand it to your AI coding agent along with the spec. The agent reads the rules and writes one function: function onIdle ( me , enemy , game ) { const d = chebyshev ( me . character . position , enemy . character . position ) if ( me . skills [ " renjian_heyi " ]?. ready && me . character . qi > 30 ) { me . cast ( " renjian_heyi " ) // finisher } else if ( d > 1 ) { me . move ( " toward_enemy " ) // close the gap } else { me . cast ( " sanhuan_taoyue " ) // basic strike } } Enter fullscreen mode Exit fullscreen mode It's called every time your action queue empties, for the whole match.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.

Read More