Game Development Reference
In-Depth Information
-0.5f, -0.5f, -0.5f, 0, 1, -1, -1, -1, // v0 = left, bottom, back
0.0f, -0.5f, 0.5f, 1, 1, 0, 0, 1, // v1 = left, bottom, front
0.0f, 0.5f, -0.5f, 0.5f, 0, 0, 1, 0, // v2 = top point
// Right Side
0.5f, -0.5f, -0.5f, 0, 1, 1, -1, -1, // v3 = right, bottom, back
0.0f, -0.5f, 0.5f, 1, 1, 0, 0, 1, // v4 = right, bottom, front
0.0f, 0.5f, -0.5f, 0.5f, 0, 0, 1, 0, // v2 = top point
// Back
-0.5f, -0.5f, -0.5f, 0, 1, -1, -1, -1, // v0 = left, bottom, back
0.5f, -0.5f, -0.5f, 1, 1, 1, -1, -1, // v3 = right, bottom, back
0.0f, 0.5f, -0.5f, 0.5f, 0, 0, 1, 0, // v2 = top point
// Bottom
-0.5f, -0.5f, -0.5f, 0, 1, -1, -1, -1, // v0 = left, bottom, back
0.5f, -0.5f, -0.5f, 1, 1, 1, -1, -1, // v3 = right, bottom, back
0.0f, -0.5f, 0.5f, 0.5f, 0, 0, 0, 1, // v4 = right, bottom, front
};
Pyramid2(Context iContext, Mesh iMesh, MeshEx iMeshEx, Texture[] iTextures, Material iMaterial,
Shader iShader)
{
super(iContext, iMesh, iMeshEx, iTextures, iMaterial, iShader);
}
}
The final composite enemy tank object with both turret and main tank body is shown in Figure 8-4 .
Figure 8-4. The tank 3D object
Creating the Tank State
The tank state machine consists of two states. One is the process command state, which
processes the commands sent to the tank and selects the behavior of the tank that implements
the command. The other state is the patrol/attack state, which drives the tank around the playfield
according to waypoints while firing at the player's power pyramid. The tank's finite state machine is
shown in Figure 8-5 .
 
Search WWH ::




Custom Search