A 3D tank game built using DirectX 3D, showcasing a fully interactive tank battle experience with customizable graphics settings and real-time gameplay features.
Tank

The DirectX3D Tank Game is a 3D action game where players control a tank on a battlefield and engage in dynamic combat with enemy tanks. The project demonstrates essential 3D game development skills, including real-time rendering, collision detection, physics handling, and user interaction, utilizing DirectX 3D.
This game was designed as a team project for college assigment with DirectX 3D & OOP.
Develop environment: Microsoft Visual Studio Community 2022 (64-bit) Graphic API: DirectX 12
- Tank Controls: Smooth and responsive controls for navigating and aiming.
- Real-Time Rendering: Real-Time graphics rendering using DirectX 3D.
- Collision Detection: Accurate collision handling between tanks, projectiles and obstacles
- Dual Mode: Two players can take turns to play.
- Perspective: The perspective includes first-person, third-person, and overhead views, with the first-person perspective particularly resembling the view from within the tank itself.
- Camera Movement: The camera follows the projectile, creating a dynamic camera view.
- DirectX 3D: For graphics rendering and creating the 3D environment.
- C++: Primary programming language.
To set up and run the game locally, follow these steps:
-
Clone the repository:
git clone https://github.com/rocknroll17/DirectX3D-Tank-Game.git
-
Open the Solution File:
- Open
VirtualLego.slnin Visual Studio. This solution includesd3dUtility.cpp,virtualLego.cpp, andd3dUtility.h.
- Open
-
Set Up Project Properties:
- Go to the Property tab of the project.
-
Edit VC++ Directories:
- Under VC++ Directories, set the Include Directories to
{SDK installation path}\Include. - Set the Library Directories to
{SDK installation path}\Lib\x86.
- Under VC++ Directories, set the Include Directories to
-
Enable Function-Level Linking:
- Go to Code Generation and set Enable Function-Level Linking to
Yes (/Gy).
- Go to Code Generation and set Enable Function-Level Linking to
-
Run the Project:
- Press
Ctrl + F5to execute the program.
- Press
-
Tank Movement:
W: Move the tank forwardA: Move the tank leftS: Move the tank backwardD: Move the tank right
-
Target Point (Blue Ball) Movement:
CtrlorE: Move the target point downShiftorQ: Move the target point up↑or Right Mouse Button: Move the target point forward←or Right Mouse Button: Move the target point left↓or Right Mouse Button: Move the target point backward→or Right Mouse Button: Move the target point right
-
Actions:
Space: Fire a shell & skip the start screenEnter: Toggle rendering state & skip the start screenV,C,1 ~ 9: Switch camera view options