mirror of
https://github.com/Xevion/Pac-Man.git
synced 2025-12-06 03:15:48 -06:00
v0.26.0
Pac-Man
Description
A faithful recreation of the classic Pac-Man arcade game written in Rust. This project aims to replicate the original game's mechanics, graphics, sound, and behavior as accurately as possible while providing modern development features like cross-platform compatibility and WebAssembly support.
The game includes all the original features you'd expect from Pac-Man:
- Classic maze navigation and dot collection
- Four ghosts with their unique AI behaviors (Blinky, Pinky, Inky, and Clyde)
- Power pellets that allow Pac-Man to eat ghosts
- Fruit bonuses that appear periodically
- Progressive difficulty with faster ghosts and shorter power pellet duration
- Authentic sound effects and sprites
Built with SDL2 for cross-platform graphics and audio, this implementation can run on Windows, Linux, macOS, and in web browsers via WebAssembly.
Feature Targets
- Near-perfect replication of logic, scoring, graphics, sound, and behaviors.
- Written in Rust, buildable on Windows, Linux, Mac and WebAssembly.
- Online demo, playable in a browser.
- Automatic build system, with releases for Windows, Linux, and Mac & Web-Assembly.
- Debug tooling
- Game state visualization
- Game speed controls + pausing
- Log tracing
- Performance details
Experimental Ideas
- Perfected Ghost Algorithms
- More than 4 ghosts
- Custom Level Generation
- Multi-map tunnelling
- Online Scoreboard
- WebAssembly build contains a special API key for communicating with server.
- To prevent abuse, the server will only accept scores from the WebAssembly build.
Build Notes
- Install
cargo-vcpkgwithcargo install cargo-vcpkg, then runcargo vcpkg buildto build the requisite dependencies via vcpkg. - For the WASM build, you need to have the Emscripten SDK cloned; you can do so with
git clone https://github.com/emscripten-core/emsdk.git- The first time you clone, you'll need to install the appropriate SDK version with
./emsdk install 3.1.43and then activate it with./emsdk activate 3.1.43. On Windows, use./emsdk/emsdk.ps1instead. - You can then activate the Emscripten SDK with
source ./emsdk/emsdk_env.shor./emsdk/emsdk_env.ps1or./emsdk/emsdk_env.batdepending on your OS/terminal. - While using the
web.build.tsis not technically required, it simplifies the build process and is very helpful.- It is intended to be run with
bun, which you can acquire at bun.sh
- It is intended to be run with
- Tip: You can launch a fileserver with
pythonorcaddyto serve the files in thedistfolder.python3 -m http.server 8080 -d distcaddy file-server --root dist(install with[sudo apt|brew|choco] install caddyor a dozen other ways)
- The first time you clone, you'll need to install the appropriate SDK version with
Languages
Rust
92.3%
TypeScript
6.1%
HTML
0.7%
Dockerfile
0.4%
Just
0.3%
Other
0.2%