Need help with pacman.c?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

245 Stars 18 Forks MIT License 132 Commits 0 Opened issues


Simple Pacman clone written in C99.

Services available


Need anything else?

Contributors list

# 36,491
131 commits


A Pacman clone written in C99 with minimal dependencies for Windows, macOS, Linux and WASM.

WASM version

For implementation details see comments in the pacman.c source file (I've tried to structure the source code so that it can be read from top to bottom).

Related projects:

  • Zig version:

Clone, Build and Run (Linux, macOS, Windows)

On the command line:

git clone
cd pacman.c
mkdir build
cd build
cmake ..
cmake --build .

NOTE: on Linux you'll need to install the OpenGL, X11 and ALSA development packages (e.g. mesa-common-dev, libx11-dev and libasound2-dev).

On Mac and Linux this will create an executable called 'pacman' in the build directory:


On Windows, the executable is in a subdirectory:


Build and Run WASM/HTML version via Emscripten

NOTE: You'll run into various problems running the Emscripten SDK tools on Windows, might be better to run this stuff in WSL.

Setup the emscripten SDK as described here:

Don't forget to run

source ./
after activating the SDK.

And then in the pacman.c directory:

mkdir build
cd build
emcmake cmake -G"Unix Makefiles" -DCMAKE_BUILD_TYPE=MinSizeRel ..
cmake --build .

To run the compilation result in the system web browser:

> emrun pacman.html

IDE Support

On Windows, cmake will automatically create a Visual Studio solution file which can be opened with the

cd build
cmake ..
start pacman.sln

On macOS, the cmake Xcode generator can be used to create an Xcode project which can be opened with the

cd build
cmake -GXcode ..
open pacman.xcodeproj

On all platforms with Visual Studio Code and the Microsoft C/C++ and CMake Tools extensions, simply open VSCode in the root directory of the project. The CMake Tools extension will detect the CMakeLists.txt file and take over from there:

cd pacman.c
code .

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.