WHYCPP is a simple, fantacy-console inspired, library to create pixel-art games. The main idea behind WHYCPP is to have fun by coding entire game, without all these fancy features a typical framework offers.
You can:
- create games in C++, C, JavaScript;
- draw EACH pixel on the screen manually;
- draw primitive shapes;
- load and draw png textures;
- play wav sounds;
- handle keyboard and mouse;
- compile game into Web Page using emscripten.
On Windows you can only develop using MSYS2 and MinGW.
When you have MSYS2 installed, run these commands to install necessary tools:
pacman -S mingw-w64-x86_64-make mingw-w64-x86_64-cmake mingw-w64-x86_64-gcc mingw-w64-x86_64-pkg-config mingw-w64-x86_64-SDL2 mingw-w64-x86_64-SDL2_mixer
For Debian-based Linux run these commands:
sudo apt install cmake make g++ libsdl2-dev libsdl2-mixer-dev
I suppose you have Homebrew installed.
Run these commands:
brew install sdl2 sdl2_mixer
You may need to activate developer tools: xcode-select --install
- Fork template project WHY_CPP_template
- Write your code in
src
dir. - Just run
make
in the terminal to compile and run. Template is preconfigured to automatically download the latest release of WHYCPP.
Or
- Fork this repository.
- Create a new dir, for example
game
, with content like we have forexample
- Add line to the
CMakeLists.txt
:add_subdirectory(game)
. - If you need, you can add to the
Makefile
new tasks likeexample-compile
andexample-run