C++ Game Programming Examples
Tiny Tanks
This is a Tiny Tank game based on its famous retro game and I developed this prototype for my course assignment as well as practising C++ game programming. The source code, executable and design documents can be downloaded from: https://www.dropbox.com/s/3motd68brana6oa/TinyTank.rar
How to Play
This is two players' game. Each player controls his/her tank to move around the map and shoot missile to the other player's tank to win for each turn. The player's tank can be destroyed by a direct hit or indirect hit (rebound from walls) from a missile.
How to Play
This is two players' game. Each player controls his/her tank to move around the map and shoot missile to the other player's tank to win for each turn. The player's tank can be destroyed by a direct hit or indirect hit (rebound from walls) from a missile.
Player 1 Controls:
Move forward - Up Arrow Key Move backward - Down Arrow Key Turn Right - Right Arrow Key Turn Left - Left Arrow Key Fire Missile - Return Key Rotate Turret to Right - Right Control Key Rotate Turret to Left - Right Shift Key |
Player 2 Controls:
Move forward - W Key Move backward - S Key Turn Right - D Key Turn Left - A Key Fire Missile - Q Key Rotate Turret to Right - Left Control Key Rotate Turret to Left - Left Shift Key |
Pacman
This is a Pacman game prototype that I developed in C++ for the course assignment. This is one of my favourite retro game I played a lot when I was a kid and how amazing to be the one creating it. Although there are no enemy intelligence in this prototype, the way that the ghosts move inside the maze looks like there are some simple AI algorithms making the ghosts looking stupid! The source code, executable and design documents can be downloaded from: https://www.dropbox.com/s/pbcokfxxdwsvcr7/Pacman.rar
Player Controls:
Move forward - W Key
Move backward - S Key
Turn Right - D Key
Turn Left - A Key
Move forward - W Key
Move backward - S Key
Turn Right - D Key
Turn Left - A Key
Pong
This is a simple Pong game prototype that I developed in C++ for learning game development. Making this game really helps to practise coding in C++ and applying Maths and Physics in the game development. The source code, executable and design documents can be downloaded from:
https://www.dropbox.com/s/vezgdnuxzfti2ii/Pong.rar
https://www.dropbox.com/s/vezgdnuxzfti2ii/Pong.rar
Player 1 Controls:
Move upward - Up Arrow Key Move downward - Down Arrow Key |
Player 2 Controls:
Move upward - Left Shift Key Move downward - Left CTRL Key |
Solar System
This is a 3D solar system that I developed in OpenGL C++ for learning 3D programming. This program will demonstrate how the earth is circulating around the sun, and how the moon is circulating around the earth etc. It is interesting to see how 3D Maths can be used to simulate our solar system. The source code, executable can be downloaded from:
https://www.dropbox.com/s/8i5ptbvs9rcwyvh/OpenGL_Solar_System.rar
https://www.dropbox.com/s/8i5ptbvs9rcwyvh/OpenGL_Solar_System.rar
Day n Night World Map with Wave Animation
This is an OpenGL program demonstrating the world map with animated ocean wave that I developed for learning GLSL Vertex Shader. The techniques of wave animation is simply by manipulating vertices on the map using sin/ cos and time uniforms. Besides, I have used the Fragment Shader to transition the daylight texture to the night-time texture. I have also tried changing the colour of the wave grid based on the height of the vertex. The source code, executable can be downloaded from: https://www.dropbox.com/s/mwe1ov9cstjxkds/OpenGL_Vertex_Shader.rar
World Map Jigsaw (Animated) Puzzle
This is an OpenGL program demonstrating the world map which splitted up into jigsaw puzzle and animated as ocean wave. I developed for learning GLSL Geometry Shader. The techniques of creating the jigsaw puzzle is simply by using the geometry shader to receive the points on the map and turning them into 2 triangles each, orientating the triangles to face the camera. The source code, executable can be downloaded from:
https://www.dropbox.com/s/fd32b0he4ecqy75/OpenGL_Geometry_Shader.rar
https://www.dropbox.com/s/fd32b0he4ecqy75/OpenGL_Geometry_Shader.rar
My Qantas Boeing 747
This is an OpenGL program demonstrating the diffuse and specular lighting that I developed in the Fragment Shader. Owing to my interest in 3D modelling and texturing , I have created my favourite Qantas Boeing 747 to be my 1st OpenGL Lighting Experiment! Besides, I have implemented a better user interface for customising light conditions e.g. RGB, Direction, Intensity ( Diffuse/ Ambient/ Specular). The source code, executable can be downloaded from:
https://www.dropbox.com/s/k6dts17ft1l06ra/OpenGL_Lighting_Shader.rar
https://www.dropbox.com/s/k6dts17ft1l06ra/OpenGL_Lighting_Shader.rar
Towards the Goal - Path Finding & Behaviour Tree
This is a project which has two OpenGL C++ programs demonstrating A* Path Finding on Navigation Mesh and Behaviour Tree. When I have finished coding up these AIs, I am amazed with how complex the AI in AAA games can be.
For the first project, the AI will decide for the shortest path in reaching its destination based on the navigation mesh.
For the second project, there are two different AIs - AI attacker and AI defender. Using behaviour tree, the AI attacker will try to dodge around the AI defender in reaching the goal, whereas the AI defender will try to block AI attackers or patrolling different area. The source code, executable can be downloaded from:
https://www.dropbox.com/s/s8mo1er0l5g076i/OpenGL_BehaviorTree.rar
For the first project, the AI will decide for the shortest path in reaching its destination based on the navigation mesh.
For the second project, there are two different AIs - AI attacker and AI defender. Using behaviour tree, the AI attacker will try to dodge around the AI defender in reaching the goal, whereas the AI defender will try to block AI attackers or patrolling different area. The source code, executable can be downloaded from:
https://www.dropbox.com/s/s8mo1er0l5g076i/OpenGL_BehaviorTree.rar
Gunshot Animation - Skinned Meshes Animation
This is an OpenGL program demonstrating the animation for skinned meshes that I developed for learning how to import animation data from the FBX loader. This technique requires adding the bone array to the shader as a uniform matrix array, and then adding indices and weights arrays to the shader input. Next call the FBX loader to pass into the bone arrays before input into the vertex shader for the skinning. The vertex shader will blend the various weights and calculates all the final vertex positions of the mesh. The source code, executable can be downloaded from:
https://www.dropbox.com/s/fmrlz64hekdyd7l/OpenGL_AnimationSkinning.rar
https://www.dropbox.com/s/fmrlz64hekdyd7l/OpenGL_AnimationSkinning.rar
Bouncing Balls Physics Simulation
This is an OpenGL program demonstrating the physics simulation that I developed using Nvidia's PhysX API. I think good physics in game is as important as pretty graphics (Look at games like Angry Birds).
It is worthwhile to learn as lots of game engines have PhysX physics engine built-in, plus it is really good fun. The source code, executable can be downloaded from:
https://www.dropbox.com/s/e6lin5bdngm3lu1/OpenGL_Physics_System.rar
It is worthwhile to learn as lots of game engines have PhysX physics engine built-in, plus it is really good fun. The source code, executable can be downloaded from:
https://www.dropbox.com/s/e6lin5bdngm3lu1/OpenGL_Physics_System.rar