Exemplo n.º 1
0
        /// <summary>
        /// Sets a default SkyBox, which is a box aligned with the border of the world.  The SkyBox is needed
        /// so that you can set the walls, ceiling or floor to different colors using setSideSolidColor or to
        /// different textures using setSideTexture.  You use these functions on the SkyBox.
        /// </summary>
        public virtual void fixSkyBox()
        {
            cRealBox3 skeleton = _border;

            if (skeleton.ZSize < 0.5f)
            {
                skeleton.setZRange(cGame.BACKGROUNDOFFSET, 1.0f); /* Move LOZ down to
                                                                   * avoid z-fighting with sprites in the xy plane.  MOve HIZ up to make
                                                                   * walls around the world.*/
            }
            setSkyBox(skeleton.LoCorner, skeleton.HiCorner, -1);
            //Make the walls four shades.
            SkyBox.setSideSolidColor(cRealBox3.LOX, Color.FromArgb(180, 30, 200));
            SkyBox.setSideSolidColor(cRealBox3.HIX, Color.FromArgb(30, 10, 180));
            SkyBox.setSideSolidColor(cRealBox3.LOY, Color.FromArgb(255, 200, 200));
            SkyBox.setSideSolidColor(cRealBox3.HIY, Color.FromArgb(10, 255, 200));
            //Make floor be almost black
            SkyBox.setSideSolidColor(cRealBox3.LOZ, Color.FromArgb(15, 15, 15));
            //Make the top side transparent
            SkyBox.setSideInvisible(cRealBox3.HIZ); /* Means make it gray and
                                                     * don't draw it. */
            SkyBox.Edged           = false;         //Turns off edges for the filled faces.
            SkyBox.LineColor       = Color.DarkGray;
            SkyBox.LineWidthWeight = cColorStyle.LW_IGNORELINEWIDTHWEIGHT;
            SkyBox.LineWidth       = 1;
        }
Exemplo n.º 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));
        }
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 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.º 6
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.º 7
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));
        }