Skip to content

A simple game about chugging milk built in C using SDL2

License

Notifications You must be signed in to change notification settings

ndugdale/milk-chug-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

83 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Contributors Forks Stargazers Issues GPLv3 License

Milk Chug

A simple game about chugging milk built in C.
Report Bug · Request Feature · Contact

Table of Contents
  1. About The Project
  2. Download
  3. Running Locally
  4. Licence
  5. Contact
  6. Acknowledgments

About the Project

Screenshot of Milk Chug game

This is a simple 2D game about a milk chugging competition. This project was built in C using the SDL2 library.

Built With

C CMake

(back to top)

Download

Download a Linux AppImage, a MacOS App, or a Windows Executable.

Running Locally

To get a local copy up and running follow the steps below:

Prerequisites

You require a C compiler compatible with the C17 standard. On Windows, this project is configured to use the MinGW gcc compiler. If building on Windows, ensure a version of MinGW for your architecture is installed and set correctly on the PATH system variable.

This project uses CMake as a build tool. You require a minimum version of 3.21. CMake can be downloaded from the website or through a package management tool on relevant OS distros. If on Windows, ensure CMake is set correctly on the PATH system variable.

E.g. on Arch-based distros:

sudo pacman -S cmake

And on MacOS:

brew install cmake

Install SDL2 and the required extension libraries: SDL2_image, SDL2_mixer, and SDL2_ttf

  • Linux: Download the libraries using the above links or your package manager of choice. E.g. on Arch-based distros:

    sudo pacman -S sdl2 sdl2_image sdl2_mixer sdl2_ttf
  • Mac: Download the .dmg for each library and copy each respective .framework directory into /Library/Frameworks. Note that installation through homebrew will not provide the required .framework files.

  • Windows: Download the tar.gz files and extract the library directory for your device's architecture (either i686-w64-mingw32 or x86_64-w64-mingw32). Rename each corresponding folder to SDL2, SDL2_image, etc. for convenience and move them to the C:/ drive where they can be found by the CMakeLists.txt.

Installation

Clone the repository. Create a build directory if one does not already exist, and navigate inside it.

git clone https://github.com/ndugdale/milk-chug-game.git
mkdir -p milk-chug-game/build
cd milk-chug-game/build

(back to top)

Build and Run

Build using CMake. This will generate an executable named MilkChug in the bin directory.

cmake ..
cmake --build .
cmake --install . # only required on windows to install dll files to bin

cd ../bin
./MilkChug

Packaging

Running the build.sh or built.bat scripts in the root directory will package the project differently according to the OS. The packaged app or installer will be located in the install directory.

On Linux or Mac:

./build.sh

On Windows:

.\build.bat
  • Linux: MilkChug-Linux-<ARCHITECTURE>.AppImage
  • Mac: MilkChug-MacOS-<ARCHITECTURE>.app
  • Windows: MilkChug-Windows-<ARCHITECTURE>.exe

Licence

Distributed under the GNU GPLv3 Licence. See LICENCE.md for more information.

(back to top)

Contact

Project Link: https://github.com/ndugdale/milk-chug-game

(back to top)

Acknowledgments

This project was only possible due to the works of others, and so I would like to extend a thank you to the following creators:

(back to top)