r/ChatGPTCoding • • 6h 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.

4 Upvotes

8 comments sorted by

1

u/Jaded_Syrup_4276 4h 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/Comprehensive-Dog35 2h ago

Nope ive decided to steer from mobile app as taking to much time doing different

1

u/tom_camping 2h ago

i had a similar thing happen with a small script i wrote for inventory tracking. turns out a global timer was ticking for every active class even when they were supposedly disabled. it is way easier to miss that than a syntax error, right?

1

u/ipreuss 5h 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 5h 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 4h 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 3h 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.