Skip to content

haiyao-ss/FF1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FF1 (pygame edition)

A Python clone of Final Fantasy 1 with all the original gameplay mechanics (party of four, FF1-style charge-based magic, turn-based combat, 13 dungeons, class promotion, four elemental crystals) — rendered with pygame sprites, not ASCII.

Run

pip3 install -r requirements.txt    # one-time
./run.sh                            # or: python3 main.py

Requires Python 3.9+ and pygame 2.5+. A 1280×768 window opens.

To force the legacy terminal UI: FF1_TERMINAL=1 python3 main.py.

Controls

All input goes through the prompt bar at the bottom of the window: type a command (movement key, menu number, character name), press Enter.

Context Keys
Overworld w a s d move; p party detail; i inventory; e equip; v save; q quit
Town menu 1-9 for shops/inn/talk; s save; l leave
Dungeon same as overworld plus l to leave (only at exit tile)
Battle a attack, m magic, i item, d defend, r run; then target number
Title 1 new game, 2 continue, 3 delete save, 4 quit

Art assets

  • Terrain tileset: planned slice from the openpixels CC0 pack. The download is bundled at assets/raw/openpixels_tileset.png. The current build does not yet slice it — every tile is drawn procedurally by game/sprites.py.
  • Monsters / characters / UI: procedurally drawn placeholders. Each name hashes to a stable color, then shape varies by trait (bosses get a diamond body, large monsters get a rounded rectangle, mages get a pointy hat). Class glyphs ("F" for Fighter, "B" for BlackMage) are stamped on the sprite as a small badge.

Other public asset packs (Wikipedia images, Kenney.nl, OpenGameArt's hot-linkable previews) were probed but blocked by the sandbox proxy, so the build falls back to deterministic procedural art for everything except the CC0 tileset. Drop additional CC0 PNGs into assets/raw/ and extend game/sprites.py to use them.

Project layout

main.py                     entry point
run.sh                      shell launcher
requirements.txt            pygame>=2.5
game/
  data.py                   game registry (classes, items, monsters, maps)
  expanded.py               extra content (merged into data.py at import)
  character.py              Character + Party + class promotion
  battle.py                 turn-based combat engine
  world.py                  overworld + towns + dungeons + NPCs
  state.py                  GameState dataclass
  save.py                   JSON save/load
  title.py                  title screen + party creation
  pygame_ui.py              pygame frontend (replaces terminal UI)
  sprites.py                sprite catalog (CC0 tileset + procedural sprites)
  ui.py                     legacy terminal UI (kept for FF1_TERMINAL=1)
  art.py                    legacy ASCII-art lookup stub (now returns None)
assets/
  raw/openpixels_tileset.png  CC0 from silveira/openpixels (vendored)
tests/
  smoke.py                  engine tests (no UI)
  e2e.py                    scripted title + party creation

Tests

python3 tests/smoke.py                                 # engine-only
SDL_VIDEODRIVER=dummy python3 tests/pygame_smoke.py    # render scenes

Content stats

59 monsters, 32 spells, 25 weapons, 27 armor pieces, 27 items, 13 dungeons, 7 towns, 7 quest NPCs. Roughly 10 hours of play if you fully explore.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages