Skip to content

About

Native retro arcade PAC-MAN in Go + Ebitengine with 100 levels and encrypted high scores

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Gemini PAC-MAN (Native Go & Ebitengine Edition) (one of my AI learning)

A 100% native, standalone retro arcade PAC-MAN game built in Go (Golang) with Ebitengine. Zero Python, Zero Pygame, Zero runtime dependencies.


🌟 Game Specifications & Features

1. 100 Dynamic Levels with Ghost Speed Scaling

  • 100 Playable Levels (Level 1 to Level 100).
  • Level 1 Ghost Speed: Exactly 75% slower than PAC-MAN ($0.25 \times \text{Pac-Man Speed}$).
  • Level 100 Ghost Speed: Exactly 50 times faster than Level 1 ($50 \times \text{Speed}_{L1} = 12.5 \times \text{Pac-Man Speed}$).
  • Smooth Formula Across 100 Levels: $$\text{GhostSpeed}(L) = \text{GhostSpeed}(1) \times \left(1 + 49 \times \frac{L - 1}{99}\right)$$
  • Energizer Scaling: Frightened duration scales from 8.0s at level 1 down to 0.5s at level 100.
Level Ghost Speed (px/f) Speed vs. PAC-MAN Speed vs. Level 1
1 0.750 px/f 25.0% (-75% slower) 1.00x
10 1.121 px/f 37.4% 1.49x
25 1.740 px/f 58.0% 2.32x
50 2.775 px/f 92.5% 3.70x
75 3.810 px/f 127.0% 5.08x
100 37.500 px/f 1250.0% (12.5x PAC-MAN) 50.00x faster than L1

2. Encrypted & Tamper-Proof Top 10 High Scores

  • High scores are saved directly in the application working folder as highscores.dat.
  • Encryption Standard: AES-256 in Counter (CTR) mode with PBKDF2-HMAC-SHA256 key derivation (100,000 iterations).
  • HMAC-SHA256 Authenticated Integrity: Digitally signed. If a player modifies any byte in a hex or text editor, tampering is detected instantly, rejecting altered data and protecting leaderboard integrity.
  • Tracks: Rank (#1 - #10), Player Name (up to 12 chars), Score, Level Reached, and Date.

3. Native Debian Linux & Windows 11 Compatibility

  • Debian Linux: Builds directly into a native ELF executable or a standalone portable AppImage (Gemini-PAC-MAN-x86_64.AppImage).
  • Windows 11: 1-command cross-compilation produces a standalone pacman.exe with no external DLLs or frameworks required.

🎮 How to Play & Controls

Action Key / Input
Move PAC-MAN Arrow Keys ($\uparrow, \downarrow, \leftarrow, \rightarrow$) or W, A, S, D (Arcade corner buffering enabled)
Start / Confirm Space or Enter
Pause / Resume P or Esc
View Top 10 High Scores H
Level Jump Selector (1-100) L (jump to any level to test speed)
Quit Game Esc (from main menu)

🚀 Building & Running on Debian Linux

Prerequisites

Install the Go compiler (if not already installed):

sudo apt update && sudo apt install -y golang

Option A: Build & Run Native AppImage (Recommended)

cd /home/plamaimu/Projects/Gemini-PAC-MAN
chmod +x scripts/*.sh
./scripts/build_appimage.sh

# Run the standalone AppImage on any Linux distribution:
./Gemini-PAC-MAN-x86_64.AppImage

Option B: Build & Run Native Linux Binary

./scripts/build.sh
./pacman

💻 Cross-Compiling for Windows 11

You can cross-compile the Windows 11 .exe directly from your Debian terminal:

./scripts/build_windows.sh

This generates pacman.exe. You can copy this single .exe file to any Windows 11 PC and double-click to play!


🧪 Running Automated Unit Tests

Run the complete Go unit test suite:

go test -v ./...

Tests automatically verify:

  • Exact Level 1 Ghost speed ratio: $0.25\times$ Pac-Man ($75%$ slower)
  • Exact Level 100 Ghost speed multiplier: $50.0\times$ Level 1
  • Monotonic speed scaling across all 100 levels
  • AES-256 authenticated encryption roundtrip
  • HMAC tamper detection on modified file bytes
  • Top 10 high score sorting, trimming, and persistence
  • Maze layout and Row 17 tunnel wrapping

🛠️ CLI Options

# Start at a specific level (e.g. Level 50 or Level 100)
./pacman -level 50

# View the 100-level speed progression table
./pacman -speed-table

# View decrypted Top 10 High Scores in terminal
./pacman -scores

# Reset high score file to arcade defaults
./pacman -reset-scores

🌐 Publishing to GitHub

To create and push this repository to your GitHub account using your existing gh credentials:

./publish_to_github.sh

Or specify repository name and visibility:

./publish_to_github.sh Gemini-PAC-MAN --public
# Or for private:
./publish_to_github.sh Gemini-PAC-MAN --private

About

Native retro arcade PAC-MAN in Go + Ebitengine with 100 levels and encrypted high scores

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages