//function to be passed into the thread that walls are spawned in //this allows us to wait a few seconds before spawning walls in order to maintain a gap between them. public void spawnWall(cVector3 enda, cVector3 endb, float thickness, float height, cGame pownergame, cCritterSlideWall.TYPE wallType, cVector3 moveAxisAndDirection, bool bounce, cVector3 startPos, cVector3 endPos) { int numWalls = 3; float spawnPos = 10; //position the ith wall must reach before the (i + 1)th wall spawns //spawn the first wall cCritterSlideWall wall = new cCritterSlideWall(enda, endb, thickness, height, pownergame, wallType, moveAxisAndDirection, bounce, startPos, endPos); cSpriteTextureBox spriteBox = new cSpriteTextureBox(wall.Skeleton, BitmapRes.Wood2, 16); wall.Sprite = spriteBox; //spawn the remaining walls for (int i = 0; i < numWalls - 1; i++) { //wait until the previous wall reaches the spawn position while (wall.Position.Z > spawnPos) { ; } //spawn the wall and add textures. wall = new cCritterSlideWall(enda, endb, thickness, height, pownergame, wallType, moveAxisAndDirection, bounce, startPos, endPos); spriteBox = new cSpriteTextureBox(wall.Skeleton, BitmapRes.Wood2, 16); wall.Sprite = spriteBox; } }
public void setRoom3() { Biota.purgeCritters("cCritterWall"); Biota.purgeCritters("cCritter3Dcharacter"); Biota.purgeCritters("cCritterBoss"); setBorder(50.0f, 20.0f, 50.0f); cRealBox3 skeleton = new cRealBox3(); skeleton.copy(_border); setSkyBox(skeleton); SkyBox.setAllSidesTexture(BitmapRes.Graphics3, 2); SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete); SkyBox.setSideSolidColor(cRealBox3.HIY, Color.Blue); _seedcount = 0; Player.setMoveBox(new cRealBox3(50.0f, 20.0f, 50.0f)); wentThrough = true; startNewRoom = Age; cCritterDoor pdwall = new cCritterDoor( new cVector3(_border.Midx, _border.Loy, _border.Loz), new cVector3(_border.Midx, _border.Midy - 3, _border.Loz), 2.0f, 2, this); cSpriteTextureBox pspritedoor = new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door); pdwall.Sprite = pspritedoor; float height = 0.1f * _border.YSize; float ycenter = -_border.YRadius + height / 2.0f; float wallthickness = cGame3D.WALLTHICKNESS + 1.0f; cCritterSlideWall pwall = new cCritterSlideWall(new cVector3(_border.Midx, ycenter - 10, _border.Midz + 10), new cVector3(_border.Hix + 50, ycenter - 10, _border.Midz + 10), height, wallthickness, this, cCritterSlideWall.TYPE.HARMFUL, new cVector3(0.0f, -0.05f, 0.0f), false, 200); cSpriteTextureBox pspritebox = new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wood2, 16); pwall.Sprite = pspritebox; seedCritters(); _ptreasure = new cCritterMedpack(this, new cVector3(_border.Midx, _border.Midy - 2.0f, _border.Loz - 1.5f * cGame3D.TREASURERADIUS)); cCritterBossDragonKnight boss = new cCritterBossDragonKnight(this, new cVector3(_border.Midx, _border.Loy, _border.Midz - 5), new DragonBullet(1.0f)); }