Tomo (UMass Hackathon I)
2nd Place out of 500+ Participants

24 Hours
Build Time
85%
Success Rate
0
Crashes
A Game with an Evolving Codebase
We wasted the first 24 hours of HackUMass XIII.
We spent that first day exploring the makerspace, pitching bad ideas, and doing everything except building a project. It wasn't until a 2 AM snack run to a gas station that the panic and the inspiration actually hit. Someone in the backseat jokingly asked, "What if we just made the AI write the game for us?"
It sounded like a cop-out at first. But the more we joked about it, the more we realized the technical challenge was actually insane. We didn't want an AI that just wrote dialogue or tweaked configuration files. We wanted an AI that wrote production code actual Python functions and injected them into a running game without crashing it.
We had exactly one day left to pull it off.
What is Tomo?
Tomo is a Space Invaders clone where ChatGPT acts as the developer in real-time. Every time you beat a level, the AI writes a new game mechanic as Python code. We inject that code into the game while it's running, so the gameplay evolves instantly without restarting.
Why is it cool?
Instead of a keyboard, you play with your hands using a Leap Motion controller. Move your hand left or right to steer. Clench your fist to shoot. The addicting part? Well it’s seeing what the AI comes up with next: each level is so distinct and unique making it exciting to discover what happens next.
Demo 📻

Try it for yourself!
The "Oh Crap" Moment
That premise sounds great in a pitch, but from an engineering perspective, it's a nightmare. You are effectively taking unverified code from an LLM and forcing your computer to run it inside a precision-based arcade game.
By 6 AM, we had a prototype where meteors fell from the sky, proving the concept worked. But getting from there to a playable demo meant solving three problems that kept trying to kill the project.
The Problem with Python's Memory
Python loves to cache things to be fast. If you import a file, Python remembers it. If you change that file and try to import it again, Python ignores the change. Since our whole game relied on appending new AI code to a file called
dynamic.py, this was a showstopper.My Solution: I wrote a system to wipe Python's memory. Before loading the new level, my code forces Python to delete the module from
sys.modules. It feels a bit illegal to do in production code, but it worked. The game loop stays alive, the module flushes, and the new mechanic loads instantly.The Leap Motion Discovery
Around 10 AM, bleary-eyed and wandering the makerspace for caffeine, we spotted a Leap Motion controller sitting on a table. It tracks hand movements with sub-centimeter accuracy.
We grabbed it, thinking it would be cool to control the ship by waving our hands. But there was a snag: the Leap Motion SDK is C++, our game was Python, and the official bindings were hopelessly outdated.
.jpeg)
My Solution: I didn't have time to write a proper API wrapper. So I improvised. I wrote a standalone C++ program that reads the hand data and pretends to be a keyboard. If your hand moves left, my program "presses" the Left Arrow key.
Then came the best part: I mapped grip strength to the spacebar. To shoot, you don't tap a button; you squeeze your hand. The harder you clench your fist, the faster the ship fires.
The Judge's Reaction
When the judges first came by, they looked skeptical. "Oh, another AI wrapper," their faces seemed to say. It felt like they thought it was childish.
Then I fired up the demo. I waved my hand, and the ship moved instantly. I clenched my fist, and bullets sprayed across the screen.
You could see their eyes brighten. One judge actually nudged me out of the way saying, "Let me try that." They spent the next five minutes just shooting aliens with their fist, grinning the whole time. That intuitive, physical connection turned their skepticism into genuine excitement. They started taking the whole pitch seriously after that.

The Deep Dive (Technical Details)
Here is how we actually pulled this off without the game crashing every five seconds.

Challenge 1: Hot Code Reloading
As mentioned, Python's import caching was the enemy. Here is the code I wrote to bypass it:
This function runs between levels. It creates a seamless transition where the code updates in the background without the player ever seeing a loading screen or a restart.
Challenge 2: Trusting the AI (But Not Really)
GPT-4o is smart, but it makes mistakes. It might write a syntax error or try to access variables that don't exist. In a normal app, that's a crash.
I decided that silence was better than a crash. I wrapped every single AI-generated function in a defensive
try-except block.If the AI writes garbage code, the game simply ignores it. The player might see a "quiet" level with no special mechanic, but the game keeps running smooth at 60 FPS.
Challenge 3: The C++ to Python Bridge
Since we couldn't link the libraries directly, I built a simple pipe architecture. The C++ program handles the complex sensor data and simplifies it into basic keystrokes that the Python game loop already understands.

This architecture meant we could debug the game using a regular keyboard, then switch to the Leap Motion for the demo without changing a single line of Python code.
Conclusion & Results
We went into the closing ceremony exhausted. There was another team from our school (WPI) that had won previous hackathons, and honestly, we were pretty sure they were going to sweep the prizes again. When they announced the 3rd place winner, and it was the other WPI team, I actually looked down at my phone, assuming we hadn't placed at all.
Then my teammate jumped out of his chair.
We took 2nd Place.
We walked up to the stage grinning like idiots, partly because we won, but mostly because we pulled off a ridiculously hard project in 24 hours.
.jpeg)
Lessons Learned
- Fail Gracefully: The
try-exceptblocks saved us. The AI definitely wrote broken code during the demo, but the judges never knew.
- Tactile > Complex: The grip-to-shoot mechanic was technically simple but experientially powerful. It sold the project more than the AI did.
- Constraint is Freedom: Constraining the AI with a massive system prompt (API contract) made it actually useful instead of just creative chaos.
End Credits
.jpeg)
.jpeg)



