Exemplo n.º 1
0
        public override void copy(cCritter pcritter)
        {
            /*We need to overload the cCritter copy because if I have
             * cCritterWallRobot which is a cCritterWall, and it gets split in two
             * by a replicate call, then I want the new copy to have all the same
             * shooting behavior as the old one.  In general, I should
             * overload copy for each of my critter child classes, but for now this
             * one is the most important.  The overload does the regular copy, then
             * looks if the thing being copied is a cCritterWall, and if it is then
             * it copies the additional fields. */
            base.copy(pcritter);
            if (!(pcritter is cCritterWall))
            {
                return; //You're done if pcritter isn't a cCritterWall*.
            }
            cCritterWall pcritterwall = (cCritterWall)(pcritter);

            /* I know it is a cCritterWall at this point, but I need
             * to do a cast, so the compiler will let me
             * access cCritterWall methods and fields. */
            cRealBox3 r = new cRealBox3();

            r.copy(pcritterwall.Skeleton);
            Skeleton          = r;
            _defaultfillcolor = pcritterwall._defaultfillcolor;
        }
Exemplo n.º 2
0
        public override cCritter copy()
        {
            cCritterWall c = new cCritterWall();

            c.copy(this);
            return(c);
        }
Exemplo n.º 3
0
        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;
        }
Exemplo n.º 4
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;
        }
Exemplo n.º 5
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;
                    }
                }
            }
        }
Exemplo n.º 6
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);
        }
Exemplo n.º 7
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());
        }
Exemplo n.º 8
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));
        }
Exemplo n.º 9
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));
        }
Exemplo n.º 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));
        }