The deployment was failing because the workflow used incorrect syntax with `uses: docker://` which caused Docker to misinterpret `up` as an executable rather than an argument to the Railway CLI. Split deployment into a separate job using `container:` at the job level, allowing the Railway CLI to execute properly. This follows Railway's official documentation for GitHub Actions integration.
Pac-Man
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 with tunnels 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
This cross-platform implementation is built with SDL2 for graphics, audio, and input handling. It can run on Windows, Linux, macOS, even web browsers via WebAssembly.
Quick Start
The easiest way to play is to visit the online demo. It is more or less identical to the desktop experience at this time.
While I do plan to have desktop builds released automatically, the game is still a work in progress, and I'm not quite ready to start uploading releases.
However, every commit has build artifacts, so you can grab the latest build artifacts if available.
Screenshots
Starting a new game
Pac-Man collecting dots and avoiding ghosts
Game over screen after losing all lives
Debug mode showing hitboxes, node graph, and performance details.
Why?
Just for fun. And because I wanted to learn more about Rust, inter-operability with C, and compiling to WebAssembly.
Originally, I was inspired by a certain code review video on YouTube; SOME UNIQUE C++ CODE // Pacman Clone Code Review. For some reason, I was inspired to try and replicate it in Rust, and it was uniquely challenging. It's not easy to integrate SDL2 with Rust, and even harder to get it working with Emscripten.
I wanted to hit a lot of goals and features, making it a 'perfect' project that I could be proud of.
- Near-perfect replication of logic, scoring, graphics, sound, and behaviors. No hacks, workarounds, or poor designs. Well documented, well-tested, and maintainable.
- Written in Rust, buildable on Windows, Linux, Mac and WebAssembly. Statically linked, no runtime dependencies, automatically built with GitHub Actions.
- Performant, low memory, CPU and GPU usage.
- Online demo, playable in a browser, built automatically with GitHub Actions.
If you're curious about the journey of this project, you can read the story file. Eventually, I will be using this as the basis for some sort of blog post or more official page, but for now, I'm keeping it within the repository as a simple file.
Roadmap
You can read the roadmap file for more details on the project's goals and future plans.
Build Notes
Since this project is still in progress, I'm only going to cover non-obvious build details. By reading the code, build scripts, and copying the online build workflows, you should be able to replicate the build process.
- Install
cargo-vcpkgwithcargo install cargo-vcpkg, then runcargo vcpkg build --manifest-path pacman/Cargo.tomlto build the requisite dependencies via vcpkg.--manifest-pathis only required if you run it from the root directory; you can omit it if youcdinto thepacmandirectory first.- This is only required for the desktop builds, not the web build.
- We use rustc 1.86.0 for the build, due to bulk-memory-opt related issues on wasm32-unknown-emscripten.
- Technically, we could probably use stable or even nightly on desktop targets, but using different versions for different targets is a pain, mainly because of clippy warnings changing between versions.
- 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.- I'm still not sure why 3.1.43 is required, but it is. Perhaps in the future I will attempt to use a more modern version.
- Occasionally, the build will fail due to dependencies failing to download. I even have a retry mechanism in the build workflow due to this.
- 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
web.build.tsauto installs dependencies, but you may need to pass-ior--install=fallback|forceto install missing packages. My guess is that if you have some packages installed, it won't install any missing ones. If you have no packages installed, it will install all of them.- If you want to have TypeScript resolution for development, you can manually install the dependencies with
bun installin theassets/sitefolder.
- If you want to have TypeScript resolution for development, you can manually install the dependencies with
Contributing
Contributions are welcome! Please feel free to submit a pull request or open an issue.
- The code is not exactly stable or bulletproof, but it is functional and has a lot of tests.
- I am not actively looking for contributors, but I will review pull requests and merge them if they are useful.
- If you have any ideas, please feel free to submit an issue.
- If you have any private issues, security concerns, or anything sensitive, you can email me at xevion@xevion.dev.
License
This project is licensed under the GPLv3 license. See the LICENSE file for details.
