Project
Frogger Inspired Game Project
The goal is to make it to the other side of the street and river
without getting hit by a car or falling into the water. I built it
in Python for a class assignment, using the Arcade library for
sprites, collision, and sound. The version below runs that exact,
unmodified Python code in your browser through Pyodide (a build of
the real Python interpreter compiled to WebAssembly), not a
rewrite. The only new code is a small stand-in for the parts of
the arcade library that need an actual desktop
window, since a browser can't open one the way Python normally
does.
Play it
Get to the top of the screen without getting hit by a car or falling in the river. Turtles will carry you across the water if you land on one.
How this actually runs
main.py, froggerFunctions.py, and
froggerHelper.py here are byte-for-byte the same
files from my GitHub repo. They get loaded into Pyodide's virtual
file system and imported normally, exactly like running
python main.py locally. The one piece that's new is
arcade.py: a small shim that gives those files an
arcade module to import, where things like
Sprite.draw() or arcade.play_sound()
forward to JavaScript canvas and audio calls instead of opening a
native OpenGL window, since that's the one part of desktop Python
a browser genuinely can't do. All of the actual game logic, movement,
collision, spawning, and sprite flipping is running as originally
written.