A Python & Pygame remake
A grid-based arcade classic — dodge cars, hop logs,
and reach the lily pads.
Guide your frog safely across a deadly road and river to reach five lily pads at the top. It sounds simple — it isn't.
The frog moves one tile at a time — not smooth walking. Precision matters more than speed.
Watch the pattern. Cars repeat at fixed intervals. Count the gaps and move when there's a clear column ahead. On higher levels, you may only have one or two tiles of window — read the road before you hop.
When you land on a log, frog.rideLog is set and your
X position is locked to the log's slot center. Your frog floats with it — until you hop off or drift out of bounds.
Filling all five lily pads triggers the level transition. The arena resets with slightly higher entity speeds — how far can you go?
# frogger.py (~480 lines, one file, no assets) class Frog: # player position, hopping, log-riding col, row # grid tile rideLog, rideSlot # None when on land centerX → slotCenterX(slot) if riding class Car: # moves left or right every frame col, row, speed, direction class Log: # river platform, 1–3 frog slots col, row, speed, slots, direction slotCenterX(slot) # pixel X for each slot class Lanes: # spawns + owns all Cars and Logs # tracks 5 lily pad states (filled / empty) spawn(), update(dt), draw(surface) main(): # game loop: input → update → draw # handles score, lives, level transitions
# screen constants tileSize = 40 # px per cell colCount = 16 # 16 columns rowCount = 17 # 17 rows hudHeight = 44 # HUD bar on top def rowY(row): return hudHeight + row * tileSize def colX(col): return col * tileSize + tileSize // 2 # lane classification by row number goalRows = {1, 2} safeRows = {0, 3, 6, 9, 12, 15, 16} waterRows = {4, 5, 7, 8, 10, 11} roadRows = {13, 14}
Click the game, then ↑ ↓ ← → / WASD to hop · Space to start. Use Next ▶ when you're done (keys won't advance slides on this screen).
lines of Python
core classes
levels (speed scales)
Python 3.9+ Pygame 2.x Grid-based movement No assets needed One-file game Arcade-faithful
A faithful Python recreation of the 1981 Konami classic. One file, zero image assets, pure shape rendering — showing that clean game architecture and fun mechanics can coexist in a small, readable codebase.
Run it: pip install pygame && python3 frogger.py