🐸

Frogger

A Python & Pygame remake


A grid-based arcade classic — dodge cars, hop logs,
and reach the lily pads.

What is Frogger?

🕹️ The Original (1981)

  • Konami arcade cabinet
  • Became a cultural icon
  • Simple premise, deep challenge
  • Top-selling arcade game of its era

🐍 This Version

  • Built with Python 3.9+
  • Uses Pygame 2.x for rendering
  • ~480 lines — one file
  • No images: pure shape drawing
  • Full level progression system

Guide your frog safely across a deadly road and river to reach five lily pads at the top. It sounds simple — it isn't.

How to Play

🎮 Controls

  • ↑ ↓ ← → hop in any direction
  • W A S D same — your choice
  • Space / Enter start / continue
  • One grid tile per hop
  • Brief cooldown prevents key spam

🎯 Objective

  • Start at the bottom safe zone
  • Cross the road — avoid cars
  • Cross the river — ride logs
  • Land on all 5 lily pads to win
  • Each new level gets faster

🐸 🐸 🐸 3 lives

The frog moves one tile at a time — not smooth walking. Precision matters more than speed.

The Game World

GOAL 🌸   Lily Pad   🌸   Lily Pad   🌸   Lily Pad   🌸   Lily Pad   🌸   Lily Pad
SAFE ━━━━━━━━━━━ safe median ━━━━━━━━━━━
RIVER
🪵 log
🪵 log
RIVER
🪵 log
SAFE ━━━━━━━━━━━ safe median ━━━━━━━━━━━
ROAD
🚗 car
🚗 car
ROAD
🚗 car
START 🐸 you start here

Zone 1 — The Road

🚗 Traffic Rules

  • 2 road lanes, cars move sideways
  • Each lane has its own direction
  • Multiple cars per lane
  • Speed increases every level
  • Touch a car → squashed 💀

📐 Grid Movement

  • Frog snaps to column/row tiles
  • Cars detected by tile overlap
  • Hop cooldown: 0.14 seconds
  • One hop = one tile forward
  • Plan your gaps, don't rush

Strategy

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.

Zone 2 — The River

🪵 Logs

  • Each log has 1–3 frog slots
  • Small dividers mark where to stand
  • Logs drift left or right
  • You ride with the log automatically
  • Log off-screen → you drown 💧

💧 Water Rules

  • Open water = instant death
  • Must hop onto a log exactly
  • You can hop between logs mid-river
  • River direction reverses by lane
  • Speed scales with each level

The Ride System

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.

Zone 3 — Lily Pads & Victory

🌸 The Goal

  • 5 lily pad slots at top
  • Each must be filled once
  • Land exactly on a pad
  • Can't reuse a filled pad
  • Score increases per pad

🏆 Scoring

  • +10 per lily pad reached
  • Score persists across levels
  • Displayed in the HUD bar
  • Lives shown alongside score
  • No time bonus (yet!)

📈 Leveling

  • Fill all 5 → next level
  • Cars get faster each level
  • Logs get faster each level
  • Speed cap prevents impossibility
  • Pads reset — loop forever

Filling all five lily pads triggers the level transition. The arena resets with slightly higher entity speeds — how far can you go?

Code Architecture

# 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
    

Grid System

# 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}
        

Lily pad / goal
Safe zone
River (water)
Road
Frog (you)

Live Demo — Play It!

Click the game, then ↑ ↓ ← → / WASD to hop · Space to start. Use Next ▶ when you're done (keys won't advance slides on this screen).

🐸

Summary

~480

lines of Python

4

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

1 / 11  |  5:00