← back to projects
Software engineering course project

Bomberman

A complete Bomberman clone in Python and Pygame, built as a full software-engineering project: requirements spec, architecture, work plan, a tested logic core and a presentation.

Runs on Windows with one double-click; the installer adds a desktop and Start-menu shortcut.

Team
4 students · 8 weeks
Stack
Python 3.10+ · Pygame
Tests
84 · ~95% of logic code
Media files
None – all drawn & synthesized in code

Level 1, drawn from the game’s own level file: walls, brick, the player, a bomb going off and two balloon enemies.

what’s in the game

Gameplay

  • 5 levels, stored as editable text files
  • Two enemy types – one wanders, one hunts you with BFS
  • Power-ups for bombs, range and speed
  • Chain-reaction explosions, a level timer and lives

Product polish

  • English or Hebrew, with right-to-left text rendering
  • Sound effects and music synthesized in code
  • Pause, persistent high scores and saved settings
  • One-click launcher and app shortcut for Windows

architecture

The key design decision: the game logic never imports Pygame. That is what lets every rule be tested without opening a window.

Display
Pygame
app.pymain loop, input, screens
renderer.pyall drawing
sound.pyeffects & music
↓ update(dt) · reads state
Logic
pure Python
game.pygame rules and the state machine
ai.pywander & BFS chase
entities.pyplayer, enemy, bomb
level.pylevel parsing & validation
grid.pythe tile map
↓ shared by both layers
Shared services
i18n.pytranslations
text.pyRTL Hebrew
settings.pylanguage & sound
highscores.pyscore table

game states

Seven states, and every path leads back to the menu.

MENUPLAYINGPAUSEDPLAYER_DIEDLEVEL_COMPLETEGAME_OVERVICTORY

two algorithms that make it smart

The enemy hunts you with BFS

Breadth-first search finds the first step on the shortest path to the player, around walls and bombs.

queue = deque([(start, None)])
while queue:
    pos, first = queue.popleft()
    for d in Direction:
        nxt = step(pos, d)
        if nxt == goal: return first or d
        if walkable(nxt) and nxt not in seen:
            seen.add(nxt)
            queue.append((nxt, first or d))

Chain reactions with a queue

Every bomb a flame touches joins the queue, and each bomb explodes exactly once.

queue = list(due_bombs)
while queue:
    bomb = queue.pop()
    if bomb in done: continue
    done.append(bomb)
    for tile in flame_path(bomb):
        other = bomb_at(tile)
        if other and other not in done:
            queue.append(other)

quality

84
pytest tests, headless – no window needed
~95%
coverage of the game-logic code
5
levels, each validated when loaded
13
slide presentation, plus SRS and work plan

key insights

Separate logic from display

Keeping Pygame out of the rules made the core testable, and turned the renderer into a thin layer that is easy to change.

Tests alongside the code

Writing tests in parallel with each module, not at the end, kept the last weeks free for user testing and polish.

Data over hard-coding

Levels are plain text files and constants live in one place, so the game can grow without touching the engine.

Engineering is more than code

A spec, a plan with roles and a presentation are what make a team project deliverable on time.

tech stack

PythonPygamepytestBFSState machineJSON persistenceBidi / RTL textSRS
← previousThe Map Lies next →FitVision AI

get in touch

Questions about a project, the code or the way it was built? I'm always happy to talk about it.