Skip to content

guillaume-gomez/MathGame

Repository files navigation

Math Game

The project is still a work in progress, some features can be buggy

Idea

The goal was to make a platform game using Maths curves as the main gameplay element.

gif

In-game img

In-game img

In-game img

How to play

Keys

  • move : arrow keys
  • next curve: P
  • previous curve: M

game modes

There is 2 game modes :

  • The first one is the normal version of the game
  • The second one is the hard mode ( you have to write your own functions )

Installation

The installation has been tested on Ubuntu 14.04 LTS.

MathGame uses external libraries that you'll have to compile yourself

SFML

sources are in the directory extlib

cd MathGame/extlibs
unzip extlibs_sources.zip
cd SFML-2.1

Before you go any further you have to install dependencies needed to compile SFML :

  • pthread ( libpthread-workqueue-dev )
  • opengl ( libgl1-mesa-dev )
  • xlib ( libx11-dev )
  • xrandr ( libxrandr-dev )
  • freetype ( libfreetype6-dev )
  • glew ( libglew-dev )
  • jpeg ( libjpeg8-dev )
  • sndfile ( libsndfile1-dev )
  • openal ( libopenal-dev )

sudo apt update && sudo apt install libpthread-workqueue-dev libgl1-mesa-dev libx11-dev libxrandr-dev libfreetype6-dev libglew-dev libjpeg8-dev libsndfile1-dev libopenal-dev

Now it's time to compile SFML ! :

mkdir build && cd build
cmake ..
sudo make install

Thor

sources are in the directory extlib

cd ../../Thor
mkdir build && cd build
cmake ..
sudo make install

If SFML isn't found, try defining the variable SFML_INCLUDE_DIR=PathToSFML/include You can do this at the cmake step :

cmake -D SFML_INCLUDE_DIR=<Your Path To SFML>/include ..

more details : official tutorial on how to install Thor

SFGUI

sources are in the directory extlib

cd ../../SFGUI
mkdir build && cd build
cmake -D CMAKE_MODULE_PATH=/usr/local/share/SFML/cmake/Modules/ ..
sudo make install

Official library site

After these installations => sudo ldconfig This will tell your system to create the necessary links and cache to the most recent shared libraries found

Compile Math Game

Using a makefile

make all
./bin/Release/ProjetMath

Through code::blocks

You just have to run the project (i.e. open "ProjetMath.cbp" )

Linker codeblocks option

  • go to build options ( right clic on project -> Build options... ), and add external libraries if there aren't already there

  • libsfml-audio.so,

  • libsfml-graphics.so,

  • libsfml-system.so,

  • libsfml-window.so,

  • libsfgui.so,

  • libthor.so

  • Under windows extensions are .a instead of .so

  • Under Linux no need to include headers

Include codeblocks option

License

GPL

About

A 2D video game made in C++ playing with math and physics

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published