A simple 3d tank shooting game demo based on Unreal4 Game Engine.
This is a very simple 3d tank shooting game demo made by Unreal4 Game Engine(C++ codes and Blueprints).
In this demo, player can use wasd
keys to control the toon tank(w/s
keys to move forward or backward, a/d
keys to rotate left or right) and left mouse key to shoot projectiles. In order to win the game, player needs to control the tank to destory all 4 turrets. If the player tank is destroyed by turrets' projectiles then the game is over and player loses.
I use Unreal4.26.2 and Visual Studio code for this project under Windows 10 environment.
Unreal download
Visual Studio 2019 download
Visual Code download
-
Download this repo, open(or zip and open) the Unreal4_Toon-Tank-Demo folder.
-
Double click the ToonTanks.uproject file.
-
Let the Unreal Game Engine rebuild the demo.
The whole project in Unreal contains 2 main folders, Content folder and C++ Classes folder.
Under Content folder, there are altogether 3 subfolders:
-
Assets folder: contains 5 subfolders including all assets we need for this game demo.
1.1. Audio folder: contains 2 sound wave audio files.
1.2. Effects folder: contains 3 particle system effects.
1.3. Materials folder: contains altogether 15 materials, material instances and material functions.
1.4. Meshes folder: contains 6 static meshes.
1.5. Textures folder: contains 3 textures.
-
Blueprints folder: contains 6 subfolders including all Blueprint classes and widget Blueprint we need for this game demo.
2.1. Actor folder: contains 1 Blueprint class indicates the projectile.
2.2. Camera folder: contains 2 Blueprint classes indicates camera shake effects when hit or explode.
2.3. GameModes folder: contains 1 Blueprint class indicates our custom GameMode class.
2.4. Pawns folder: contains 2 Blueprint classes indicates our tank and turret classes.
2.5. PlayerControllers folder: contains 1 Blueprint class indicates our custom PlayerController class.
2.6. Widgets folder: contains 2 widget Blueprint indicate
GameStart()
andGameOver()
functions. -
Maps folder: contains 1 level object indicates our main game map.
Under C++ Classes folder, there is 1 subfolder:
-
ToonTanks folder: contains 5 subfolders of C++ classes we need for this game demo.
1.1. Actor folder: contains 1
ProjectileBase
class indicates the projectile class.1.2. Components folder: contains 1
HealthComponent
class indicates our custom health component for the tank and turrets.1.3. GameModes folder: contains 1
TankGameModeBase
class indicates our custom GameModeBase class.1.4. Pawns folder: contains 3 classes,
PawnBase
class for all derived classes' parent class,PawnTank
class for the tank andPawnTurret
class for turrets.1.5. PlayerControllers folder: contains 1
PlayerControllerBase
indicates our custom PlayerController class.