Game Development Reference
In-Depth Information
11.
Creates an explosion that is used when the tank is hit by the player's weapon
projectiles
12.
Creates the tank, sets the sound effects associated with the tank to true, and
returns the tank
Listing 8-63. Creating the Tank
Tank CreateTankType1(Context iContext)
{
//Weapon
Weapon TankWeapon = CreateTankWeaponType1(iContext);
// Material
Material MainBodyMaterial = new Material();
MainBodyMaterial.SetEmissive(0.0f, 0.4f, 0.0f);
// Texture
Texture TexTankMainBody = new Texture(iContext,R.drawable.ship1);
int NumberMainBodyTextures = 1;
Texture[] MainBodyTexture = new Texture[NumberMainBodyTextures];
MainBodyTexture[0] = TexTankMainBody;
boolean AnimateMainBodyTex = false;
float MainBodyAnimationDelay = 0;
// Mesh
Mesh MainBodyMesh = new Mesh(8,0,3,5,Pyramid2.Pyramid2Vertices);
MeshEx MainBodyMeshEx= null;
// Turret
//Material
Material TurretMaterial=new Material();
TurretMaterial.SetEmissive(0.4f, 0.0f, 0.0f);
// Texture
Texture TexTankTurret = new Texture(iContext,R.drawable.ship1);
int NumberTurretTextures = 1;
Texture[] TurretTexture = new Texture[NumberTurretTextures];
TurretTexture[0] = TexTankTurret;
boolean AnimateTurretTex = false;
float TurretAnimationDelay = 0;
// Mesh
Mesh TurretMesh= new Mesh(8,0,3,5,Pyramid2.Pyramid2Vertices);
MeshEx TurretMeshEx = null;
// Turret Offset
Vector3 TurretOffset = new Vector3(0, 0.2f, -0.3f);
// Shaders
Shader iShader = new Shader(iContext, R.raw.vsonelight, R.raw.fsonelight); // ok
Search WWH ::




Custom Search