OpenGL C++ game made with glut.h, stb_image.h and miniaudio.h. Third semester final project. For Windows only. The point of this project is to use only single file header libraries (other than GLUT and standard library) to make a presentable arcade game.
- Clone this repository
- Download this zip containing OpenGL dependencies from MdAlbinHossain/Computer-Graphics
- Extract the zip, open the folder
Computer-Graphics > OpenGL Programming
- Inside, copy 'mingw' and '.vscode' folder into this repo's folder you've cloned earlier (
shuttle-madness
) - On VSCode, install an extension called Run++ (this one)
- Still on VSCode,
File > Open Folder...
and choose the cloned directory (shuttle-madness
)
I haven't tried this myself, but you need to do a GLUT installation by yourself, and run the program with this (there might be other dependencies, tbh idk how to install those manually).
g++.exe shuttle_madness.cpp -lfreeglut -lopengl32 -lglu32 -lwinmm -lgdi32 -Wl,--subsystem,windows -o shuttle_madness
- Open
shuttle_madness.cpp
- Click the
Run++
button on the top right, OR press Alt + B
- WASD controls:
W
to jump/double jump.S
to fastfall/crouch. Space
to swing the racket- Immediately jumping after releasing crouch button will result in high jump.
- Hit the pink shuttlecock to score point, dodge the gray shuttlecock, and don't hit the yellow shuttlecock.
- Download
cmake
from here and install it. (Choose the Windows x64 Installer, recommended to install for all user). - Make sure that the
mingw32
folder from the previous guide is located properly inside the repo's folder (shuttle-madness
) or - You can use your locally installed MSYS64 if you have already installed one.
I tried several dev tools and only MSYS64 which works (aside the above mingw32 method), my MSYS2 apparently can't. So for other build tools, you need to adjust the CMakeLists.txt
manually. And to make things worse, the built executable from the MSYS64 method can't run on other device. So, just stick with the mingw32 method.
- Run
cmakeautomate_mingw32.py
inside thetools
folder - Go to newly made
build
folder, the executable name isShuttleMadness.exe
(it needs the png and wav files to be on the same directory as it). There will also a zip file that contains everything you need to run the game.
Use cmakeautomate_msys64.py
instead if you want to use MSYS64 method.
- Inside the repo folder, create a new folder named
build
- Download
ninja-win.zip
from here - Extract it, put the
ninja.exe
inside thebuild folder
- Launch command prompt (
cmd.exe
), change directory (cd
) to the build folder - Type these in succesion,
if you're using mingw32 (default) method:
for %I in ("%CD%") do set "updir=%~dpI"
set "updir=%updir:\=/%"
cmake -G "Ninja" -DCMAKE_MAKE_PROGRAM=%updir%build/ninja.exe -DCMAKE_PREFIX_PATH=%updir%mingw32 -DCMAKE_C_COMPILER=%updir%mingw32/bin/gcc.exe -DCMAKE_CXX_COMPILER=%updir%mingw32/bin/c++.exe ..
cmake ..
ninja
if you're using MSYS64 method:
cmake -G "Ninja" -DCMAKE_MAKE_PROGRAM=ninja.exe ..
cmake ..
ninja
- Go to newly made
build
folder, the executable name isShuttleMadness.exe
(it needs the png and wav files to be on the same directory as it).
- Download Enigma Virtual Box, install it.
- Run
enigmavirtualboxsetup.py
inside thetools
folder - Double click the
shuttle_build.evb
, it should open the Enigma Virtual Box app. - Click
Process
on the bottom right - Visit
build
folder, the executable name isShuttleMadnessPortable.exe
(you can move it wherever you like)
- Open the
Enigma Virtual Box
app. - Browse the input file name, choose the newly built
ShuttleMadness.exe
- Click
Add > Add File(s)
, choose every.png
,.wav
, and.dll
file inside thebuild
folder. Also includeshuttle_howtoplay.txt
andshuttle_audio_credit.txt
. - Click
Process
on the bottom right - Visit
build
folder, the executable name isShuttleMadnessPortable.exe
(you can move it wherever you like)
- Make challenges (like how the way the shuttlecock spawns) as a reason for the player to not just stay on the bottom without jumping at all. (also challenges that utilizes ducking)
- Make the directory clean (separate files into folders based on extension)
Figure out the build dependency problem- Static linking the
libfreeglut.dll
-
Arcade Music Loop.wav
by joshuaempyre on freesound.org Adjusted so that the volume is 20% of the original -
Jump_C_05.wav
by cabled_mess on freesound.org -
Tennis racket_whoosh.wav
by speedygonzo on freesound.org Cutted so that only the second last swing that plays -
Badminton.wav
by PerMagnusLindborg on freesound.org Cutted so that it plays a little bit faster -
8-bit damage sound.wav by EVRetro
on freesound.org Cutted so that it ends earlier -
retro taking damage sfx.wav
by stumpbutt on freesound.org -
8-bit Explosion2.aiff
by timgormly on freesound.org Converted to 24bit pcm wav, decreased the volume to 50% -
Game over sounds 1.wav
by afleetingspeck on freesound.org Cutted so that only the first part is used -
pause.mp3
by crisstanza on freesound.org Converted to 24bit pcm wav, decreased the volume to 60% -
Chiptune Loop Episode 01.wav
by orginaljun on freesound.org Decreased the tempo by 30% -
Menu screen mouse over.wav
by DrMinky on freesound.org Amplified by 15dB -
SFX UI Button Click.wav
by suntemple on freesound.org Amplified by 15dB
- Ikhsan Ridwan who made the
shuttle_knight.png
sprite
The directory itself is messy since I thought I was just gonna use the single cpp file and the single file headers, but eventually i split the code into parts, and i added images, musics, and icon.