This was my final project for my associate degree in Computer Science (December 2017), marking the completion of my first sixteen months of programming experience. It was written over four months with very limited prior knowledge of C or C++ (or Git).
The project is a fully playable first-person shooter (FPS) where the player competes against simple bots on randomly generated maps.
My personal objective was to use a limited set of libraries to gain a deep understanding of how everything works. I used GLFW to manage the window and handle the keyboard, GLAD to load OpenGL's functions, GLM for basic matrix and vector calculus, stb_image to load the textures, and FreeType to display text. This project was heavily influenced by https://learnopengl.com/.
Some shortcuts were taken to deliver a fully playable FPS on time. For example, there is no lighting, the maps are a bit square, and the bots have complete knowledge of the map. However, the physics engine does not depend on the squareness of the maps.
I am not the author of the textures. The credits can be found in source.txt.
The Web Assembly port is an addition from 2024.
- A: Move left
- D: Move right
- W: Move forward
- S: Move backward
- C: Change view (switch between player and bots' views)
- N: No Clip mode (pass through walls)
- R: Reload (new game)
- 1: First type of fire
- 2: Second type of fire
Emscripten has to be installed
mkdir build
cd build
emcmake cmake ..
emmake make
- Serve the build folder
ex:
python -m http.server
- Open
build/JeuSynthese.html
with a browser
The following dependencies are required: dl, GL, glfw3, m, freetype, X11, Xcursor, Xi, Xinerama, Xrandr, Xxf86vm
On Ubuntu:
sudo apt-get install libgl1-mesa-dev libglfw3 libglfw3-dev libfreetype6-dev libx11-dev libxcursor-dev libxi-dev libxinerama-dev libxrandr-dev libxxf86vm-dev
mkdir build
cd build
cmake ..
make
The game has to be launched from the root folder
./build/JeuSynthese
Dependencies: glfw3, opengl32, freetype271
Libraries: libs
Headers: include
The dll for freetype is included in libs.
The dll for glfw3.dll can be downloaded on http://www.glfw.org/. There is already one included for VisualStudio 2015 64 bit in libs.