示例#1
0
        //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 override cSprite copy( )
        {
            cSpriteTextureBox s = new cSpriteTextureBox();

            s.copy(this);
            return(s);
        }
示例#3
0
		//Just sets the fill colors 
	
		//cSprite overloads 
	
		public override void copy( cSprite psprite ) //Use this in copy constructor and operator= 
		{ 
			base.copy( psprite ); 
			if ( !psprite.IsKindOf( "cSpriteTextureBox" )) 
				return ; //You're done if psprite isn't a cSpriteTextureBox*.
			cSpriteTextureBox ptexturebox = ( cSpriteTextureBox )( psprite ); /* I know it is a
			cSpriteTextureBox at this point, but I need to do a cast, so the compiler will 
			let me call cSpriteTextureBox methods. */
            _pskeleton.copy(ptexturebox._pskeleton);
		} 
        //setRoom1 creates a new room when the player runs through the previous door
        public void setRoom1( )
        {
            //remove critters and wall
            Biota.purgeCritters("cCritterWall");
            Biota.purgeCritters("cCritter3Dcharacter");

            setBorder(64.0f, 16.0f, 64.0f); // size of the world

            //create new room 'shell'
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);

            //set textures and graphics
            SkyBox.setSideTexture(cRealBox3.HIZ, BitmapRes.Wall3);    //Make the near HIZ transparent
            SkyBox.setSideTexture(cRealBox3.LOZ, BitmapRes.Wall3);    //Far wall
            SkyBox.setSideTexture(cRealBox3.LOX, BitmapRes.Wall3);    //left wall
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Wall3);    //right wall
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete); //floor
            SkyBox.setSideTexture(cRealBox3.HIY, BitmapRes.Concrete); //ceiling

            //set number of critters to be created. Adjust numbers for increasing difficulty between rooms
            _seedcount = 7;

            WrapFlag = cCritter.BOUNCE;
            setPlayer(new cCritter3DPlayer(this));
            _ptreasure = new cCritterTreasure(this);

            //create a door at a new position in the room
            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Lox, _border.Loy, _border.Midz),
                new cVector3(_border.Lox, _border.Midy - 3, _border.Midz),
                0.1f, 2, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;

            //move player to new position in next room
            Player.moveTo(new cVector3(0.0f, -10.0f, 32.0f));

            //set collision flag and reset age of new room
            wentThrough  = true;
            startNewRoom = Age;
        }
示例#5
0
        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));
        }
        public cGame3D()
        {
            doorcollision = false;
            _menuflags   &= ~cGame.MENU_BOUNCEWRAP;
            _menuflags   |= cGame.MENU_HOPPER;           //Turn on hopper listener option.
            _spritetype   = cGame.ST_MESHSKIN;
            setBorder(64.0f, 16.0f, 64.0f);              // size of the world

            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);

            /* In this world the coordinates are screwed up to match the screwed up
             * listener that I use.  I should fix the listener and the coords.
             * Meanwhile...
             * I am flying into the screen from HIZ towards LOZ, and
             * LOX below and HIX above and
             * LOY on the right and HIY on the left. */
            SkyBox.setSideTexture(cRealBox3.HIZ, BitmapRes.Wall3);    //Make the near HIZ transparent
            SkyBox.setSideTexture(cRealBox3.LOZ, BitmapRes.Wall3);    //Far wall
            SkyBox.setSideTexture(cRealBox3.LOX, BitmapRes.Wall3);    //left wall
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Wall3);    //right wall
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete); //floor
            SkyBox.setSideTexture(cRealBox3.HIY, BitmapRes.Concrete); //ceiling

            WrapFlag   = cCritter.BOUNCE;
            _seedcount = 7;
            setPlayer(new cCritter3DPlayer(this));
            _ptreasure = new cCritterTreasure(this);

            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Lox, _border.Loy, _border.Midz),
                new cVector3(_border.Lox, _border.Midy - 3, _border.Midz),
                0.1f, 2, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;
        }
        public void setRoom1( )
        {
            Biota.purgeCritters <cCritterWall>();
            Biota.purgeCritters <cCritter3Dcharacter>();
            Biota.purgeCritters <cCritterShape>();
            setBorder(10.0f, 15.0f, 10.0f);
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);
            SkyBox.setAllSidesTexture(BitmapRes.Graphics1, 2);
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);
            SkyBox.setSideSolidColor(cRealBox3.HIY, Color.Blue);
            _seedcount = 0;;;
            Player.setMoveBox(new cRealBox3(10.0f, 15.0f, 10.0f));
            float zpos                 = 0.0f; /* Point on the z axis where we set down the wall.  0 would be center,
                                                * halfway down the hall, but we can offset it if we like. */
            float        height        = 0.1f * _border.YSize;
            float        ycenter       = -_border.YRadius + height / 2.0f;
            float        wallthickness = cGame3D.WALLTHICKNESS;
            cCritterWall pwall         = new cCritterWall(
                new cVector3(_border.Midx + 2.0f, ycenter, zpos),
                new cVector3(_border.Hix, ycenter, zpos),
                height,        //thickness param for wall's dy which goes perpendicular to the
                //baseline established by the frist two args, up the screen
                wallthickness, //height argument for this wall's dz  goes into the screen
                this);
            cSpriteTextureBox pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16); //Sets all sides

            /* We'll tile our sprites three times along the long sides, and on the
             * short ends, we'll only tile them once, so we reset these two. */

            pwall.Sprite = pspritebox;
            wentThrough  = true;
            startNewRoom = Age;
        }
示例#8
0
        //Constructors

        public cGame()
        {
            _seedcount       = COUNTSTART;
            _gameover        = false;
            _maxscore        = MAXSCORE;
            _scorecorrection = 0;
            _wrapflag        = cCritter.WRAP;
            _bDragging       = false;
            _pfocus          = null;
            _pplayer         = null;
            _border          = new cRealBox3(cGame.WORLDWIDTH, cGame.WORLDHEIGHT); //Default no zsize, computes faster.
            _pskybox         = null;
            _cursorpos       = new cVector3(0.0f, 0.0f);
            _level           = 1;
            _spritetype      = cGame.ST_SPRITETYPENOTUSED;
            _menuflags       = (cGame.MENU_ALL & ~cGame.MENU_AUTOPLAY & ~cGame.MENU_HOPPER);
            _newgame         = true;
            //Fix the static readonlys

            /* Reset the various static readonlys that may have been set to different values by previously
             * running some other game. */
            cCritter.Maxspeed     = cGame.CRITTERMAXSPEED;
            cCritter.MinRadius    = cGame.CRITTERMINRADIUS;
            cCritter.MaxRadius    = cGame.CRITTERMAXRADIUS;
            cCritter.BulletRadius = cGame.BULLETRADIUS;
            //Allocate the pointer variables.
            _pbiota         = new cBiota(this);
            _pcollider      = new cCollider();
            _pcontroller    = Framework.Keydev;
            _plightingmodel = new cLightingModel(true); //Default lighting model enables lights.
            setBorder(cGame.WORLDWIDTH, cGame.WORLDHEIGHT, 0.0f);
            // setBorder initializes _pskybox as well

            //Set the player, we want to make sure a game always has a player
            setPlayer(new cCritterPlayer(this)); //Sets _pplayer AND adds it to _pbiota.
        }
示例#9
0
        public cGame(cBiota pbiota)
        {
            _pcollider   = new cCollider();
            _pcontroller = Framework.Keydev;
            _pbiota      = pbiota;
            _pbiota.setGame(this);
            _pfocus         = new cCritter();
            _border         = new cRealBox3();
            _pskybox        = new cSpriteTextureBox();
            _plightingmodel = new cLightingModel();
            _cursorpos      = new cVector3();

            //Deleting the _pbiota killed off your _pplayer, so you need to get a new one.
            if (_pbiota.Size > 0) // use the first member of pbiota if there is one.
            {
                _pplayer = _pbiota.GetAt(0);
            }
            else //otherwise make a dummy.
            {
                _pplayer = new cCritter();
                cCritter pdummyplayer = new cCritter();
                setPlayer(pdummyplayer);
            }
        }
示例#10
0
        public void setRoom2()
        {
            Biota.purgeCritters("cCritterWall");
            Biota.purgeCritters("cCritter3Dcharacter");
            Biota.purgeCritters("cCritter3DCharacterEnemy");
            setBorder(BORDER_XZ, BORDER_Y, BORDER_XZ);
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);
            SkyBox.setAllSidesTexture(BitmapRes.BossRoom, 0);
            SkyBox.setSideTexture(cRealBox3.LOX, BitmapRes.BossRoom_90r);
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.BossRoom_90r);
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);
            SkyBox.setSideSolidColor(cRealBox3.HIY, Color.Blue);
            _seedcount = 0;
            Player.setMoveBox(new cRealBox3(BORDER_XZ, BORDER_Y, BORDER_XZ));
            Player.MaxSpeed = 30;              //reduce player max speed to account for smaller room
            Player.moveTo(new cVector3(_border.Midx, _border.Midy, _border.Hiz));
            float zpos                 = 0.0f; /* Point on the z axis where we set down the wall.  0 would be center,
                                                * halfway down the hall, but we can offset it if we like. */
            float        height        = 0.1f * _border.YSize;
            float        ycenter       = -_border.YRadius + height / 2.0f;
            float        wallthickness = cGame3D.WALLTHICKNESS;
            cCritterWall pwall         = new cCritterWall(
                new cVector3(_border.Lox, ycenter, zpos),
                new cVector3(_border.Hix, ycenter, zpos),
                _border.YSize - 4, //thickness param for wall's dy which goes perpendicular to the
                //baseline established by the frist two args, up the screen
                wallthickness,     //height argument for this wall's dz  goes into the screen
                this);
            cSpriteTextureBox pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16); //Sets all sides

            /* We'll tile our sprites three times along the long sides, and on the
             * short ends, we'll only tile them once, so we reset these two. */

            pwall.Sprite = pspritebox;
            wentThrough  = true;
            startNewRoom = Age;
            movingWall   = new cCritterMovingWall(
                new cVector3(_border.Midx - 2, _border.Midy, _border.Loz + 10.0f),
                new cVector3(_border.Midx - 2, _border.Midy, _border.Loz + 2.0f),
                10.0f, 1, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(movingWall.Skeleton, BitmapRes.Door);

            movingWall.Sprite = pspritedoor;
            shouldMoveWall    = true;

            //spawn two bosses in final room
            cCritter3DBoss boss1 = new cCritter3DBoss(this);

            boss1.moveTo(new cVector3(_border.Hiz - 3.0f, _border.Loy, _border.Hix - 3.0f));
            cCritter3DBoss boss2 = new cCritter3DBoss(this);

            boss2.moveTo(new cVector3(_border.Loz + 3.0f, _border.Loy, _border.Lox + 3.0f));

            cCritterDragonball dball6 = new cCritterDragonball(this);

            dball6.moveTo(new cVector3(_border.Lox, Border.Loy, _border.Hiz - 3.0f));

            cCritterDragonball dball7 = new cCritterDragonball(this);

            dball7.moveTo(new cVector3(_border.Hix - 2, Border.Loy, _border.Loz + 2));
        }
示例#11
0
 /// <summary>
 /// Used to set the SkyBox, a box set around the player and critters, which allows colors and textures to
 /// be added to the walls, ceiling and floor (on the SkyBox object, use setSideSolidColor or setSideTexture,
 /// for example).  The skybox is set using two vectors which represent the corners.  The first vector contains the
 /// lowest coordinate values of x, y, and z, and the second vector contains the highest coordinate values of x, y, and z.
 /// </summary>
 /// <param name="locorner">Contains the lowest coordinate values of x, y, and z.</param>
 /// <param name="hicorner">Contains the highest coordinate values of x, y, and z.</param>
 /// <param name="resourceID">You can use this to set textures to all sides (individual sides can be changed later).
 /// Use BitmapRest to select the texture to use.  This paramater is set to -1 by default, which means just
 /// use plain rectangles initially for the faces.</param>
 public void setSkyBox(cVector3 locorner, cVector3 hicorner, int resourceID = -1)
 {
     _pskybox = new cSpriteTextureBox(locorner, hicorner, resourceID);
     //	_pskybox->setColorStyle(new cColorStyle());
 }
示例#12
0
        public void setRoom1( )
        {
            Biota.purgeCritters("cCritterWall");
            Biota.purgeCritters("cCritter3Dcharacter");
            Biota.purgeCritters("cCritterWank");
            Biota.purgeCritters("cCritterGohan");
            setBorder(BORDER_XZ, BORDER_Y, BORDER_XZ);
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);
            SkyBox.setAllSidesTexture(BitmapRes.Dragonball_bg3, 0);
            SkyBox.setSideTexture(cRealBox3.LOX, BitmapRes.Dragonball_bg3_90r);
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Dragonball_bg3_90r);
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);
            SkyBox.setSideSolidColor(cRealBox3.HIY, Color.Blue);
            _seedcount = 0;
            Player.setMoveBox(new cRealBox3(BORDER_XZ, BORDER_Y, BORDER_XZ));
            Player.MaxSpeed = 50; //reduce player max speed to account for smaller room
            Player.moveTo(new cVector3(_border.Midx, _border.Midy, _border.Hiz));
            float zpos    = 0.0f; /* Point on the z axis where we set down the wall.  0 would be center,
                                   * halfway down the hall, but we can offset it if we like. */
            float height  = 0.1f * _border.YSize;
            float ycenter = -_border.YRadius + height / 2.0f;

            wentThrough  = true;
            startNewRoom = Age;
            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Lox, _border.Loy, _border.Midz),
                new cVector3(_border.Lox, _border.Midy - 3, _border.Midz),
                0.1f, 3, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;

            //Draw the ramp
            float        width = 10.0f;
            cCritterWall pwall = new cCritterWall(
                new cVector3(_border.Hix - width / 2.0f, _border.Loy - 1, _border.Hiz - 2.0f),
                new cVector3(_border.Hix - width / 2.0f, _border.Loy + 6, zpos),
                width,
                cGame3D.WALLTHICKNESS,
                this);
            cSpriteTextureBox stb = new cSpriteTextureBox(pwall.Skeleton,
                                                          BitmapRes.Wood2, 2);

            pwall.Sprite = stb;

            //draw a platform at the end of the ramp
            cCritterWall pPlatform = new cCritterWall(
                new cVector3(_border.Hix - _border.XSize / 2.0f, _border.Loy + 6, zpos),
                new cVector3(_border.Hix - _border.XSize / 2.0f, _border.Loy + 6, _border.Loz),
                _border.XSize,
                cGame3D.WALLTHICKNESS,
                this);
            cSpriteTextureBox pPlatformSprite = new cSpriteTextureBox(pPlatform.Skeleton, BitmapRes.Wall3, 16);

            pPlatform.Sprite = pPlatformSprite;

            //draw a wall on the lox of the ramp
            cCritterWall pRampWall = new cCritterWall(
                new cVector3(_border.Hix - width, _border.Midy, _border.Hiz - 3),
                new cVector3(_border.Hix - width, _border.Midy, zpos),
                cGame3D.WALLTHICKNESS,
                _border.YSize,
                this);
            cSpriteTextureBox pRampWallSprite = new cSpriteTextureBox(pRampWall.Skeleton, BitmapRes.Wall3, 16);

            pRampWall.Sprite = pRampWallSprite;

            //close off the upstairs room
            cCritterWall pUpstairsWall = new cCritterWall(
                new cVector3(_border.Hix - width, _border.Midy + 0.35f * _border.YSize, zpos),
                new cVector3(_border.Lox, _border.Midy + 0.35f * _border.YSize, zpos),
                _border.YSize,
                cGame3D.WALLTHICKNESS,
                this);
            cSpriteTextureBox pUpstairsWallSprite = new cSpriteTextureBox(pUpstairsWall.Skeleton, BitmapRes.Wall3, 16);

            pUpstairsWall.Sprite = pUpstairsWallSprite;
            cCritter3DCharacterEnemy enemy = new cCritter3DCharacterEnemy(this);

            enemy.moveTo(new cVector3(0.0f, -4.0f, 0.0f));
            cCritter3DCharacterEnemy enemy2 = new cCritter3DCharacterEnemy(this);

            enemy2.moveTo(new cVector3(_border.Midx, _border.Loz + 4, _border.Hiy));


            //Insert dragonballs
            cCritterDragonball dball3 = new cCritterDragonball(this);

            dball3.moveTo(new cVector3(_border.Midx, Border.Loy, _border.Midz));

            cCritterDragonball dball4 = new cCritterDragonball(this);

            dball4.moveTo(new cVector3(_border.Midx, Border.Midy + 3, _border.Loz + 4));

            cCritterDragonball dball5 = new cCritterDragonball(this);

            dball5.moveTo(new cVector3(_border.Hix - 2, Border.Loy, _border.Midz - 2));
        }
示例#13
0
        public cGame3D()
        {
            doorcollision = false;
            _menuflags   &= ~cGame.MENU_BOUNCEWRAP;
            _menuflags   |= cGame.MENU_HOPPER;           //Turn on hopper listener option.
            _spritetype   = cGame.ST_MESHSKIN;
            setBorder(64.0f, 16.0f, 64.0f);              // size of the world

            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);

            /* In this world the coordinates are screwed up to match the screwed up
             * listener that I use.  I should fix the listener and the coords.
             * Meanwhile...
             * I am flying into the screen from HIZ towards LOZ, and
             * LOX below and HIX above and
             * LOY on the right and HIY on the left. */
            SkyBox.setSideSolidColor(cRealBox3.HIZ, Color.Aqua);        //Make the near HIZ transparent
            SkyBox.setSideSolidColor(cRealBox3.LOZ, Color.Aqua);        //Far wall
            SkyBox.setSideSolidColor(cRealBox3.LOX, Color.DarkOrchid);  //left wall
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Wall2, 2);   //right wall
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Graphics3);  //floor
            SkyBox.setSideTexture(cRealBox3.HIY, BitmapRes.Sky);        //ceiling

            WrapFlag   = cCritter.BOUNCE;
            _seedcount = 7;
            setPlayer(new cCritter3DPlayer(this));
            _ptreasure   = new cCritterTreasure(this);
            shape        = new cCritterShape(this);
            shape.Sprite = new cSphere(3, Color.DarkBlue);
            shape.moveTo(new cVector3(Border.Midx, Border.Hiy, Border.Midz));

            /* In this world the x and y go left and up respectively, while z comes out of the screen.
             * A wall views its "thickness" as in the y direction, which is up here, and its
             * "height" as in the z direction, which is into the screen. */
            //First draw a wall with dy height resting on the bottom of the world.
            float zpos                 = 0.0f; /* Point on the z axis where we set down the wall.  0 would be center,
                                                * halfway down the hall, but we can offset it if we like. */
            float        height        = 0.1f * _border.YSize;
            float        ycenter       = -_border.YRadius + height / 2.0f;
            float        wallthickness = cGame3D.WALLTHICKNESS;
            cCritterWall pwall         = new cCritterWall(
                new cVector3(_border.Midx + 2.0f, ycenter, zpos),
                new cVector3(_border.Hix, ycenter, zpos),
                height,                 //thickness param for wall's dy which goes perpendicular to the
                                        //baseline established by the frist two args, up the screen
                wallthickness,          //height argument for this wall's dz  goes into the screen
                this);
            cSpriteTextureBox pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16);                   //Sets all sides

            /* We'll tile our sprites three times along the long sides, and on the
             * short ends, we'll only tile them once, so we reset these two. */

            pwall.Sprite = pspritebox;


            //Then draw a ramp to the top of the wall.  Scoot it over against the right wall.
            float planckwidth = 0.75f * height;

            pwall = new cCritterWall(
                new cVector3(_border.Hix - planckwidth / 2.0f, _border.Loy, _border.Hiz - 2.0f),
                new cVector3(_border.Hix - planckwidth / 2.0f, _border.Loy + height, zpos),
                planckwidth,                 //thickness param for wall's dy which is perpenedicualr to the baseline,
                                             //which goes into the screen, so thickness goes to the right
                wallthickness,               //_border.zradius(),  //height argument for wall's dz which goes into the screen
                this);
            cSpriteTextureBox stb = new cSpriteTextureBox(pwall.Skeleton,
                                                          BitmapRes.Wood2, 2);

            pwall.Sprite = stb;

            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Lox, _border.Loy, _border.Midz),
                new cVector3(_border.Lox, _border.Midy - 3, _border.Midz),
                0.1f, 2, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;
        }
示例#14
0
        public void setRoom1( )
        {
            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.Sky, 2);
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);

            _seedcount = 0;
            Player.setMoveBox(new cRealBox3(50.0f, 20.0f, 50.0f));
            wentThrough  = true;
            startNewRoom = Age;

            _ptreasure = new cCritterMedpack(this, new cVector3(_border.Midx, _border.Loy + 2.0f,
                                                                _border.Midz + 2.0f * cGame3D.TREASURERADIUS));

            float rampRaise = 0.5f;
            float height    = 1.0f;
            float width     = 10.0f;

            // add ramp
            cCritterWall pwall = new cCritterWall(
                new cVector3(_border.Midx, _border.Loy - rampRaise, _border.Hiz - 3.0f),
                new cVector3(_border.Midx, _border.Loy + rampRaise, _border.Hiz - 5.0f),
                width,  //thickness param for wall's dy which goes perpendicular to the
                //baseline established by the frist two args, up the screen
                height, //height argument for this wall's dz  goes into the screen
                this);
            cSpriteTextureBox pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Metal, 16); //Sets all sides

            pwall.Sprite = pspritebox;

            // add boss platform
            pwall = new cCritterWall(
                new cVector3(_border.Midx, _border.Loy + rampRaise, _border.Hiz - 5.0f),
                new cVector3(_border.Midx, _border.Loy + rampRaise, _border.Loz),
                width,  //thickness param for wall's dy which goes perpendicular to the
                //baseline established by the frist two args, up the screen
                height, //height argument for this wall's dz  goes into the screen
                this);
            pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Metal, 16); //Sets all sides
            pwall.Sprite = pspritebox;

            // add door
            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Midx, _border.Loy + rampRaise, _border.Loz),
                new cVector3(_border.Midx, _border.Midy - 3 + rampRaise, _border.Loz),
                2.0f, 2, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;

            seedCritters();

            new cCritterBossMog(this, new cVector3(_border.Midx, _border.Loy + rampRaise, _border.Loz), new PulseBullet());
        }
示例#15
0
        public void setRoom2()
        {
            Biota.purgeCritters("cCritterWall");
            Biota.purgeCritters("cCritter3Dcharacter");
            Biota.purgeCritters("cCritterBoss");
            setBorder(50.0f, 40.0f, 50.0f);
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);
            SkyBox.setAllSidesTexture(BitmapRes.Graphics1, 2);
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);
            SkyBox.setSideSolidColor(cRealBox3.HIY, Color.Blue);
            _seedcount = 0;
            Player.setMoveBox(new cRealBox3(50.0f, 40.0f, 50.0f));
            wentThrough  = true;
            startNewRoom = Age;

            //add door
            cCritterDoor      pdwall      = new cCritterDoor(new cVector3(_border.Midx, _border.Loy + 4, _border.Loz), new cVector3(_border.Midx, _border.Loy + 10, _border.Loz), 2.0f, 3.0f, this);
            cSpriteTextureBox pspritedoor = new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;

            float wallThickness = 5.0f, wallHeight = 10.0f;
            //starting block
            cVector3          enda          = new cVector3(Border.Midx, Border.Loy + 1, Border.Hiz);
            cVector3          endb          = new cVector3(Border.Midx, Border.Loy + 1, Border.Hiz - 5);
            cCritterWall      startingBlock = new cCritterWall(enda, endb, wallThickness, wallHeight, this);
            cSpriteTextureBox pspritebox    =
                new cSpriteTextureBox(startingBlock.Skeleton, BitmapRes.Wood2, 16); //Sets all sides

            startingBlock.Sprite = pspritebox;
            //ending block
            cVector3          enda2       = new cVector3(Border.Midx, Border.Loy + 1, Border.Loz + 7);
            cVector3          endb2       = new cVector3(Border.Midx, Border.Loy + 1, Border.Loz);
            cCritterWall      endBlock    = new cCritterWall(enda2, endb2, wallThickness, 8.0f, this);
            cSpriteTextureBox pspritebox2 =
                new cSpriteTextureBox(endBlock.Skeleton, BitmapRes.Wood2, 16); //Sets all sides

            endBlock.Sprite = pspritebox2;
            //floor
            cVector3     enda3 = new cVector3(Border.Midx, Border.Loy, Border.Loz);
            cVector3     endb3 = new cVector3(Border.Midx, Border.Loy, Border.Hiz);
            DamagingWall floor = new DamagingWall(enda3, endb3, 0.5f, 0.5f, this);

            //med pack
            _ptreasure = new cCritterMedpack(this, new cVector3(Border.Midx, Border.Loy + 7, Border.Hiz - 4));

            //sliding walls (spawned based on pos of starting block)
            cVector3 leftEnd = new cVector3();

            leftEnd.addassign(startingBlock.Position.add(new cVector3(0, 4.0f, -0.5f)));
            cVector3 rightEnd = new cVector3();

            rightEnd.copy(leftEnd);
            rightEnd.addassign(new cVector3(0, 0, -5.0f));
            float    thickness = 0.1f, height = 0.3f;
            cVector3 moveAxisandDirection = new cVector3(0, 0, -0.005f);
            cVector3 startPos             = new cVector3();

            startPos.copy(rightEnd);
            cVector3 endPos = new cVector3();

            endPos.copy(startPos);
            endPos.Z = Border.Loz + 9.5f;

            //spawn sliding walls in a separate thread
            new Thread(() =>
                       spawnWall(leftEnd, rightEnd, thickness, height, this, cCritterSlideWall.TYPE.PLATFORM, moveAxisandDirection, false, startPos, endPos)).Start();

            seedCritters();
            Player.moveTo(startingBlock.Position.add(new cVector3(0, 10.0f, 0)));
            new cCritterBossDrFreak(this, endBlock.Position.add(new cVector3(0, 10.0f, 0)), new KnockbackBullet(), 5);
        }
示例#16
0
        public cRoom(cGame3D game, int room = 1)
        {
            this.game = game;
            game.Biota.purgeCritters <cCritterWall>();
            game.Biota.purgeCritters <cCritter3Dcharacter>();
            game.Biota.purgeCritters <cCritterShape>();
            doorcollision = false;
            int roomSize = 100;

            if (room == 1)
            {
                Room1();
            }
            if (room == 2)
            {
                Room2();
            }
            if (room == 3)
            {
                Room3();
            }
            game.setBorder(roomSize, 16.0f, roomSize);             // size of the world


            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(game.Border);
            game.setSkyBox(skeleton);
            game.SkyBox.setSideSolidColor(cRealBox3.HIZ, Color.Green);            //Make the near HIZ transparent
            game.SkyBox.setSideSolidColor(cRealBox3.LOZ, Color.Green);            //Far wall
            game.SkyBox.setSideSolidColor(cRealBox3.LOX, Color.DarkOrchid);       //left wall
            game.SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Wall2, 2);        //right wall
            game.SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Graphics3);       //floor
            game.SkyBox.setSideTexture(cRealBox3.HIY, BitmapRes.Sky);             //ceiling
            width = roomSize / mazePlanx.Count;



            for (int i = 0; i < mazePlanx.Count; i++)
            {
                for (int j = 0; j < mazePlanx.Count; j++)
                {
                    if (mazePlanx[i][j])
                    {
                        float        height        = 0.3f * game.Border.YSize;
                        float        ycenter       = -game.Border.YRadius + height / 2.0f;
                        float        wallthickness = cGame3D.WALLTHICKNESS;
                        cCritterWall pwall         = new cCritterWall(
                            new cVector3(game.Border.Hix - (width * j), ycenter, game.Border.Hiz - (width * i)),
                            new cVector3(game.Border.Hix - (width * (j + 1)), ycenter, game.Border.Hiz - (width * i)),
                            height,                             //thickness param for wall's dy which goes perpendicular to the
                            //baseline established by the frist two args, up the screen
                            wallthickness,                      //height argument for this wall's dz  goes into the screen
                            game);
                        cSpriteTextureBox pspritebox =
                            new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16);                             //Sets all sides

                        pwall.Sprite = pspritebox;
                    }
                }
            }
            for (int i = 0; i < mazePlanx.Count; i++)
            {
                for (int j = 0; j < mazePlanx.Count; j++)
                {
                    if (mazePlanz[i][j])
                    {
                        float        height        = 0.3f * game.Border.YSize;
                        float        ycenter       = -game.Border.YRadius + height / 2.0f;
                        float        wallthickness = cGame3D.WALLTHICKNESS;
                        cCritterWall pwall         = new cCritterWall(
                            new cVector3(game.Border.Hix - (width * i), ycenter, game.Border.Hiz - (width * j)),
                            new cVector3(game.Border.Hix - (width * i), ycenter, game.Border.Hiz - (width * (j + 1))),
                            wallthickness,                      //thickness param for wall's dy which goes perpendicular to the
                                                                //baseline established by the frist two args, up the screen
                            height,                             //height argument for this wall's dz  goes into the screen
                            game);
                        cSpriteTextureBox pspritebox =
                            new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16);                             //Sets all sides

                        pwall.Sprite = pspritebox;
                    }
                }
            }
        }
示例#17
0
        public cGame3D()
        {
            doorcollision = false;
            _menuflags   &= ~cGame.MENU_BOUNCEWRAP;
            _menuflags   |= cGame.MENU_HOPPER;           //Turn on hopper listener option.
            _spritetype   = cGame.ST_MESHSKIN;
            setBorder(BORDER_XZ, BORDER_Y, BORDER_XZ);   // size of the world
            cRealBox3 skeleton = new cRealBox3();

            skeleton.copy(_border);
            setSkyBox(skeleton);
            shouldMoveWall = false;

            /* In this world the coordinates are screwed up to match the screwed up
             * listener that I use.  I should fix the listener and the coords.
             * Meanwhile...
             * I am flying into the screen from HIZ towards LOZ, and
             * LOX below and HIX above and
             * LOY on the right and HIY on the left. */
            SkyBox.setSideTexture(cRealBox3.HIY, BitmapRes.Sky);                //ceiling
            SkyBox.setSideTexture(cRealBox3.LOY, BitmapRes.Concrete);           //floor
            SkyBox.setSideTexture(cRealBox3.LOX, BitmapRes.Dragonball_bg1_90r); //Left Wall - flip 90r
            SkyBox.setSideTexture(cRealBox3.HIX, BitmapRes.Dragonball_bg1_90r); //Right Wall -flip 90l
            SkyBox.setSideTexture(cRealBox3.HIZ, BitmapRes.Dragonball_bg1);     //Front Wall
            SkyBox.setSideTexture(cRealBox3.LOZ, BitmapRes.Dragonball_bg1);     //Back Wall

            WrapFlag   = cCritter.BOUNCE;
            _seedcount = 0;
            setPlayer(new cCritter3DPlayer(this));

            /* In this world the x and y go left and up respectively, while z comes out of the screen.
             * A wall views its "thickness" as in the y direction, which is up here, and its
             * "height" as in the z direction, which is into the screen. */
            //First draw a wall with dy height resting on the bottom of the world.
            float zpos                 = 0.0f; /* Point on the z axis where we set down the wall.  0 would be center,
                                                * halfway down the hall, but we can offset it if we like. */
            float        height        = _border.YSize;
            float        ycenter       = -_border.YRadius + height / 2.0f;
            float        wallthickness = cGame3D.WALLTHICKNESS;
            cCritterWall pwall         = new cCritterWall(
                new cVector3(_border.Midx + 10.0f, ycenter, zpos - 12),
                new cVector3(_border.Hix, ycenter, zpos - 12),
                height,                 //thickness param for wall's dy which goes perpendicular to the
                                        //baseline established by the frist two args, up the screen
                wallthickness,          //height argument for this wall's dz  goes into the screen
                this);
            cSpriteTextureBox pspritebox =
                new cSpriteTextureBox(pwall.Skeleton, BitmapRes.Wall3, 16);                   //Sets all sides

            /* We'll tile our sprites three times along the long sides, and on the
             * short ends, we'll only tile them once, so we reset these two.*/

            pwall.Sprite = pspritebox;

            cCritterWall pNEWall = new cCritterWall(
                new cVector3(_border.Midx + 10.0f, _border.Midy, zpos - 17),
                new cVector3(_border.Midx + 10.0f, _border.Midy, _border.Loz),
                wallthickness,
                height,
                this);
            cSpriteTextureBox pNEWallSprite = new cSpriteTextureBox(pNEWall.Skeleton, BitmapRes.Wall3, 16);

            pNEWall.Sprite = pNEWallSprite;

            cCritterDoor pdwall = new cCritterDoor(
                new cVector3(_border.Midx, _border.Loy, _border.Loz - 0.9f),
                new cVector3(_border.Midx, _border.Midy, _border.Loz - 0.9f),
                5.0f, 2, this);
            cSpriteTextureBox pspritedoor =
                new cSpriteTextureBox(pdwall.Skeleton, BitmapRes.Door);

            pdwall.Sprite = pspritedoor;

            cCritterWank wank = new cCritterWank(this);

            wank.moveTo(new cVector3(_border.Hix - 4.0f, 0.0f, _border.Loz + 4.0f));

            cCritter3DCharacterEnemy enemy_1 = new cCritter3DCharacterEnemy(this);

            enemy_1.moveTo(new cVector3(_border.Hix - 3.0f, _border.Midy + 3.0f, _border.Loz + 10.0f));

            cCritterDragonball dball1 = new cCritterDragonball(this);

            dball1.moveTo(new cVector3(_border.Midx, Border.Loy, _border.Midz));

            cCritterDragonball dball2 = new cCritterDragonball(this);

            dball2.moveTo(new cVector3(_border.Hix - 6, Border.Loy, _border.Loz + 6));
        }