Exemple #1
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));
        }
Exemple #2
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));
        }