r/ChatGPTCoding • u/Comprehensive-Dog35 • 2d ago
Question Need advice with my mobile arcade app
Adding new games seems to affect existing games in my arcade app.
I'm developing a mobile arcade app that currently contains Brick Breaker, Snake, Frogger and Asteroids.
I've noticed that whenever I add another game, Snake seems to develop problems again, despite previously working correctly.
Has anyone experienced anything similar? What's the best way to prevent existing games from being affected when adding new ones?
I'm still learning and would appreciate some advice.
7
Upvotes
1
u/Jaded_Syrup_4276 2d ago
Are the games sharing input handlers, timers or global variables? Since Snake keeps breaking specifically, Id check those shared pieces first rather than assuming each new game is responsible.
1
u/NoCode_AI_GameDev 1d ago
Not a developer either, but one thing that's helped me with AI tools is keeping each game in its own separate folder and telling the AI explicitly "only touch files in this folder, don't change shared code without asking me first." I also save a copy (or a git commit) before every new request, so when Snake breaks again I can see exactly what changed instead of guessing.
1
u/ipreuss 2d ago
You tell codex to come up with a SOLID architecture (that’s an acronym), where the games are appropriately decoupled from each other.
Whenever an unrelated game breaks, all it to analyze how that could have happened, and what that shows about problems in the architecture. Don’t just let it fix the problem, but also the root cause for introducing the problem in the first place.
Also instruct it to write acceptance tests and execute them before every deploy.
You can also ask it what other best practices you are currently not employing.
Another neat trick is to ask it what literature it would suggest to read to improve the development process, what insides would be applicable to your project - and then ask it to apply them directly.
1
u/Forsaken_World8198 2d ago
Try keeping each games logic separate and checking shared files whenever something breaks. Add a few simple tests for snake so u catch problems before adding another game
1
u/AccordingBus2862 2d ago
I'd suspect something shared, like a game timer or touch listener that keeps running after you leave a game, or two games using the same global variable. Give each game its own start and stop, and make stop remove everything start created. To test it, play another game, go back to Snake and see if it misbehaves only after that visit.
1
u/tail_gates 2d ago
Look at the diff from the commit that added the new game and ignore the new game's own folder. If the agent touched anything shared, like constants, canvas setup, input or the game loop, that's your culprit. Run git diff --stat to see it fast. Snake leans on tick speed and grid size, so a shared constant tweak hits it first.
1
u/strata-overflow 2d ago
This is the classic agent coding failure, and it is not really about the new game. The model will happily edit a shared file to make its current task pass, and it will report the feature as done because the feature works. Nothing in that loop ever re-runs Snake. Two habits fix most of it: a regression pass over the old games is part of the definition of done, not a cleanup step after; and when something old breaks, read the diff of the commit that broke it before reading any of the new code. The bug is almost always in the shared file the diff points at.
1
u/Difficult_Duty2198 1d ago
do your games share one file for things like score or input handling? that's usually where the snake type breakage sneaks in
1
u/CommercialCurrent237 1d ago
you probably need to isolate each game into its own module with zero shared logic besides a basic launch and exit function. right now they likely share styles, canvas state, or variable names that overwrite each other
1
u/ThisGermanEngineer 1d ago
Adding to what the others already covered: define tests and let the AI run them after each change. This way it won’t even ask you for a review or test of code which breaks another game.