//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;
        }
Example #2
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 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;
        }
Example #5
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);
        }
Example #6
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());
        }