Reworks README, adds '.gitignore' and externalizes "configuration"

This commit is contained in:
Samuel FORESTIER 2017-11-11 18:11:58 -05:00
parent f6ec96490b
commit 54464971d1
5 changed files with 79 additions and 36 deletions

37
.gitignore vendored Normal file

@ -0,0 +1,37 @@
# Created by https://www.gitignore.io/api/c++
### C++ ###
# Prerequisites
*.d
# Compiled Object files
*.slo
*.lo
*.o
*.obj
# Precompiled Headers
*.gch
*.pch
# Compiled Dynamic libraries
*.so
*.dylib
*.dll
# Fortran module files
*.mod
*.smod
# Compiled Static libraries
*.lai
*.la
*.a
*.lib
# Executables
*.exe
*.out
*.app
# End of https://www.gitignore.io/api/c++

@ -1,18 +1,18 @@
# 2048 by HorlogeSkynet
# 2048
Simple 2048 game for Linux written in C++ running with OpenGL
> Simple 2048 game for GNU/Linux written in C++ running with OpenGL.
## How to test it:
## Install and run the game
1. Install the requirement: `aptitude install freeglut3-dev`
2. Get the project: `git clone https://github.com/HorlogeSkynet/2048.git`
3. Move into the folder: `cd ./2048/`
4. Compile the project: `g++ -o 2048 ./src/*.cpp -lGLU -lGL -lglut -Wall -Wextra -Werror`
5. Run the game: `./2048`
1. Install the requirements : `aptitude install git g++ freeglut3-dev`
2. Fetch the sources : `git clone https://github.com/HorlogeSkynet/2048.git`
3. Move into the folder : `cd ./2048/`
4. Compile the project : `g++ -o 2048.out ./src/*.cpp -lGLU -lGL -lglut -Wall -Wextra -Werror`
5. Run the game : `./2048.out`
## How to tweak the game:
## How to tweak the game
In `./inc/header.h` you've got the main settings ready to be changed !
In `./inc/options.h` you've got the main settings ready to be changed !
## To do:

@ -14,31 +14,7 @@
#include <GL/glut.h>
#include "case.h"
/* Window settings */
#define POSITION_X 764
#define POSITION_Y 256
#define SIZE_X 512
#define SIZE_Y 512
#define FONT GLUT_BITMAP_TIMES_ROMAN_24
#define DARKMODE 1
/* ............... */
/* Game settings */
#define GRID 4
#define WINUMBER 2048
#define KEEPLAYING 1
/* ............. */
/* Texts */
#define WON " You won !"
#define LOSE " You lose !"
#define END "That\'s the end ! Well played !"
/* ..... */
#include "options.h"
void game(int*, char**);

30
inc/options.h Normal file

@ -0,0 +1,30 @@
#ifndef OPTIONS_H
#define OPTIONS_H
/* Window settings */
#define POSITION_X 764
#define POSITION_Y 256
#define SIZE_X 512
#define SIZE_Y 512
#define FONT GLUT_BITMAP_TIMES_ROMAN_24
#define DARKMODE 1
/* ............... */
/* Game settings */
#define GRID 4
#define WINUMBER 2048
#define KEEPLAYING 1
/* ............. */
/* Texts */
#define WON " You won !"
#define LOSE " You lose !"
#define END "That\'s the end ! Well played !"
/* ..... */
#endif

@ -10,7 +10,7 @@ void initialisationGlut(int *argc, char **argv)
glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE);
glutInitWindowSize(SIZE_X, SIZE_Y);
glutInitWindowPosition(POSITION_X, POSITION_Y);
glutCreateWindow("2048 by HorlogeSkynet");
glutCreateWindow("2048");
glutDisplayFunc(display);
glutReshapeFunc(reshape);
glutSpecialFunc(special);