You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tools and libraries are available for making cross-platform C games, but simple examples can be hard to find.
This project is an example of how you can get started making a game in C that will work on Windows, Mac and Linux.
Screenshots
Games
Tet
A Tetris clone which is getting way too large. Cool animations, sound, controller support, multiplayer etc.
This is too much for a "tiny" game so I'll be paring it down and moving the fully featured version to its own branch or repo.
Flappy
The original tiny game. It's just Flappy Bird in only around 200 [normal] lines of code. So no dumb tricks, I hope :)
Blocko
A Minecraft (Infiniminer?) clone with too many features once again. Dynamic lighting and overly complex procedural generation.
Also needs to be simplified for this repo.
Zel
A top-down adventure game with an overworld and a dungeon. Very minimal, no ending. Too much procedural generation!
Maker
A quick hack to make Zel into more of a 2D platformer. Very rough around the edges. The intention is to add a simple level editor.
How do I run this?
Anything that supports CMake should work. But here are some suggestions for various platforms:
Windows
Install Visual Studio (you can use the free Community Edition)
Make sure to check the box for "C++ CMake Tools for Windows." This may be under "Desktop development with C++"
Open the tinyc.games folder in Visual Studio. It should detect the CMake config and set everything up
Use the play button to build & run, e.g. blocko.exe
Linux
Create a build directory inside tinyc.games
mkdir build
cd build
Run CMake to fetch libraries and create build scripts
cmake ..
You make need to run cmake -DCMAKE_POLICY_VERSION_MINIMUM=3.5 .. if your CMake is very new.
Build!
cmake --build . # build all games
cmake --build . --target=blocko # build only blocko
Run, for example, blocko
./blocko
MacOS
Install CMake. For example if you have Homebrew, run brew install cmake
In the tinyc.games directory, run cmake . -G Xcode to generate an Xcode project file
Open the project file with Xcode
Next?
After you're done playing an exhilirating demo game, open a .c file in your favorite text editor. You're now looking at the actual code you just ran. So feel free to tinker and run it with your changes. Or use it as a starting point for your own game!