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
For Windows 11 WSLg users (click here to expand)
Please make sure you have graphical x11 support installed (should be installed by default) :
sudo apt-get install libgl1 libxkbcommon-x11-0
Also, make sure wsl --version outputs at least the following :
WSL Version : 1.2.5.0
kernel Version : 5.15.90.1
WSLg Version : 1.0.51
If not, please update your WSLg version by following the instructions here. tl;dr : type this in your powershell :
# will only work if you have the latest Windows 11 update
wsl --shutdown
wsl --update
Then compile a release version of the program with :
make release
To reduce compile time, you can use the -j flag to compile in parallel. For example, if you have 4 cores, you can use make -j4 release to compile in 4 threads.
This project uses the -std=gnu++17 flag to compile and the produced executable binary is to be found inside of the bin folder.
π More infos and Usage
Warning
We use SDL2 as the only external dependency. Others dependencies are compiled from source (please see lib folder). Note that if not specified, all files are written by @ThomasByr.
Notable ones are :
ctpl.hpp, a C++11 header-only library for thread pools
ini.hpp, a single-file header-only library for INI files
json.hpp, a single-file header-only library for JSON (by Niels Lohmann)
We provide a makefile to ease the compilation process. It is composed of the following targets :
make release : compiles the program in release mode
make debug : compiles the program in debug mode
make clean : cleans the build directory and the binary
make run : runs the program
make docs : generates the documentation (and opens it in your default browser)
There would be more to it, but these are the basics. To build the documentation, you will need doxygen and graphviz installed :
sudo apt-get install doxygen graphviz
The documentation is to be found inside of the html folder.
π§ͺ Testing
Oh god... please don't.
Still, make sure you have valgrind up and ready and then run :
that is not sufficiently commented or isn't well formated
without any proper test suite
with a failing or incomplete test suite
Happy coding ! π
βοΈ License
This project is licensed under the AGPL-3.0 new or revised license. Please read the LICENSE file. In addition :
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of the pac-man authors nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
π Changelog
Beta first minor release (click here to expand)
v0.1.0 first release
brought back ctpl.hpp (thread pool)
added ini.hpp (INI files) and json.hpp (JSON files)
made some header files for game logic
v0.1.1 fps counter
added fps with bitmap font
target fps is now respected (π₯³)
v0.2.x pacman entity logic
pacman correctly responds to user input
stops when hitting a wall
changes direction (if registered) when hitting a wall
eats dots
v0.3.x some system pause and wait stuff
added pseudo keypressed event checkers
wait_for_ms w/ internal chrono
v0.4.x ghost entity logic
ghost entity on display
added chasing algorithms
added scatter mode and frightened (pure random) mode