Game Development Reference
In-Depth Information
Creates the pyramid's textures by calling PyramidCreateTexture() and
setting them up in an array called PyramidTex for use with the player's
pyramid.
4.
5.
Creates a new power pyramid object.
6.
Sets the texture animation properties for the pyramid, so that the textures
cycle between one another.
7.
Sets the initial position, rotation, and scale of the pyramid.
8.
Sets the effect of gravity on the pyramid to none.
9.
Sets the pyramid's grid spotlight and spotlight radius.
10.
Sets the pyramid's mass to 2000 to indicate that this is a very large structure
compared to other enemy objects in the game that will be colliding with it.
The collisions that occur with other objects in the game will reflect this.
11.
Creates the explosion sound associated with the pyramid and sets the sound
effects on for the pyramid.
Creates a SphericalPolygonExplosion explosion and adds it to the pyramid
using the AddExplosion() function.
12.
Listing 7-57. Creating the Player's Power Pyramid
void CreatePyramid(Context iContext)
{
//Create Cube Shader
Shader Shader = new Shader(iContext, R.raw.vsonelight, R.raw.fsonelight); // ok
// Create Debug Local Axis Shader
Mesh PyramidMesh = new Mesh(8,0,3,5,Pyramid.PyramidVertices);
// Create Material for this object
Material Material1 = new Material();
Material1.SetEmissive(0.0f, 0.0f, 0.5f);
Material1.SetGlowAnimation(true);
Material1.GetEmissiveMax().Set(0.45f, 0.45f, 0.25f);
Material1.GetEmissiveMin().Set(0, 0, 0);
// Create Texture
PyramidCreateTexture(iContext);
Texture[] PyramidTex = new Texture[2];
PyramidTex[0] = m_TexPyramid1;
PyramidTex[1] = m_TexPyramid2;
m_Pyramid = new PowerPyramid(iContext, PyramidMesh, null, PyramidTex, Material1, Shader );
m_Pyramid.SetAnimateTextures(true, 0.3f, 0, 1);
Search WWH ::




Custom Search