コード例 #1
0
ファイル: HelpScreen.cs プロジェクト: TadCordle/Project-Jack
        public HelpScreen()
        {
            world = new World(new Vector2(0, 9.8f));

            MapData data = Map.LoadCastle(world);
            walls = data.walls;
            walls.Add(new Wall(world, 970, 540, 20, 1500, 0));
            LocalPlayer.AllowLongRange = true;
            LocalPlayer.AllowTraps = true;
            player = new LocalPlayer(world, new Vector2(700, 500) * MainGame.PIXEL_TO_METER, Category.Cat1, 1.5f, 1f, 1f, false, LocalPlayer.Colors[1], PlayerIndex.One);
        }
コード例 #2
0
ファイル: HelpScreen.cs プロジェクト: TadCordle/Project-Jack
        public HelpScreen()
        {
            world = new World(new Vector2(0, 9.8f));

            walls = new List<Wall>();
            walls.Add(new Wall(world, 300, 100, 400,20,0));
            walls.Add(new Wall(world, 300, 700, 400, 20, 0));
            walls.Add(new Wall(world, 100, 400, 20, 600, 0));
            walls.Add(new Wall(world, 500, 400, 20, 600, 0));

            player = new LocalPlayer(world, new Vector2(400, 400) * MainGame.PIXEL_TO_METER, Category.Cat1, 3f, 1f, 1f, false, LocalPlayer.Colors[1], PlayerIndex.One);
        }
コード例 #3
0
ファイル: SingleMap.cs プロジェクト: Kyle44/Project-Jack
        public SingleMap()
        {
            world = new World(new Vector2(0, 9.8f)); // That'd be cool to have gravity as a map property, so you could play 0G levels

            testFigure1 = new LocalPlayer(world, new Vector2(480 * MainGame.PIXEL_TO_METER, 480 * MainGame.PIXEL_TO_METER), Category.Cat1, 1.5f, Color.Red, PlayerIndex.One);
            testFigure2 = new LocalPlayer(world, new Vector2(1200 * MainGame.PIXEL_TO_METER, 480 * MainGame.PIXEL_TO_METER), Category.Cat2, 1.5f, Color.Green, PlayerIndex.Two);

            walls = new List<Wall>();
            walls.Add(new Wall(world, 960 * MainGame.PIXEL_TO_METER, 1040 * MainGame.PIXEL_TO_METER, 1200 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 0.0f));
            //			walls.Add(new Wall(world, 360 * MainGame.PIXEL_TO_METER, 540 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 1080 * MainGame.PIXEL_TO_METER, 0.0f));
            //			walls.Add(new Wall(world, 1560 * MainGame.PIXEL_TO_METER, 540 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 1080 * MainGame.PIXEL_TO_METER, 0.0f));
        }
コード例 #4
0
ファイル: FreeForAll.cs プロジェクト: TadCordle/Project-Jack
        public FreeForAll(Color[] colors, string mapString, float gravity, int minutes, int lives, float limbStrength, bool suddenDeath, bool traps, bool longRange, bool bots)
        {
            world = new World(new Vector2(0, gravity));

            MapData data = Map.LoadMap(world, mapString);
            background = data.background;
            walls = data.walls;
            spawnPoints = data.spawnPoints;
            Vector3[] ammoPoints = data.ammoPoints;
            ammo = new TrapAmmo[ammoPoints.Length];
            if (traps)
                for (int i = 0; i < ammoPoints.Length; i++)
                    ammo[i] = new TrapAmmo(world, new Vector2(ammoPoints[i].X, ammoPoints[i].Y) * MainGame.PIXEL_TO_METER, (int)ammoPoints[i].Z);
            music = data.music;
            MediaPlayer.Play(music);
            foreground = data.foreground;

            StickFigure.AllowTraps = traps;
            StickFigure.AllowLongRange = longRange;

            player = new StickFigure[bots ? 4 : colors.Length];
            this.info = new PlayerValues[bots ? 4 : colors.Length];

            for (int i = 0; i < colors.Length; i++)
                if (colors[i] != null)
                {
                    player[i] = new LocalPlayer(world, spawnPoints[i] * MainGame.PIXEL_TO_METER, Categories[i], 1.5f, limbStrength, suddenDeath ? 0.001f : 1f, false, colors[i], Players[i]);
                    player[i].LockControl = true;
                }

            if (bots && colors.Length < 4)
            {
                for (int i = colors.Length; i < 4; i++)
                {
                    player[i] = new BotPlayer(world, spawnPoints[i] * MainGame.PIXEL_TO_METER, Categories[i], 1.5f, limbStrength, suddenDeath ? 0.001f : 1f, false, new Color(i * 60, i * 60, i * 60), Players[i], player);
                    player[i].LockControl = true;
                }
            }

            for (int i = 0; i < info.Length; i++)
                info[i] = new PlayerValues(lives);

            timed = minutes > 0;
            millisLeft = (minutes == 0 ? -1 : minutes * 60000);
            startPause = 180;
            gameOver = false;
            winners = new List<int>();
            winSticks = new List<StickFigure>();
            enterPressed = true;
        }
コード例 #5
0
        public TeamDeathmatch(Color[] colors, string mapString, float gravity, int minutes, int lives, float limbStrength, bool suddenDeath, bool traps, bool longRange, bool bots)
        {
            world = new World(new Vector2(0, gravity));

            object[] map = Map.LoadMap(world, mapString);
            background = (Texture2D)map[0];
            walls = (List<Wall>)map[1];
            spawnPoints = (Vector2[])map[2];
            Vector3[] ammoPoints = (Vector3[])map[3];
            ammo = new TrapAmmo[ammoPoints.Length];
            if (traps)
                for (int i = 0; i < ammoPoints.Length; i++)
                    ammo[i] = new TrapAmmo(world, new Vector2(ammoPoints[i].X, ammoPoints[i].Y) * MainGame.PIXEL_TO_METER, (int)ammoPoints[i].Z);

            StickFigure.AllowTraps = traps;
            StickFigure.AllowLongRange = longRange;

            player = new StickFigure[bots ? 4 : colors.Length];
            this.info = new PlayerValues[bots ? 4 : colors.Length];

            for (int i = 0; i < colors.Length; i++)
                if (colors[i] != null)
                {
                    player[i] = new LocalPlayer(world, spawnPoints[i] * MainGame.PIXEL_TO_METER, Categories[i], 1.5f, limbStrength, suddenDeath ? 0.001f : 1f, i % 2 == 1, colors[i], Players[i]);
                    player[i].LockControl = true;
                }

            if (bots && colors.Length < 4)
            {
                for (int i = colors.Length; i < 4; i++)
                {
                    player[i] = new BotPlayer(world, spawnPoints[i] * MainGame.PIXEL_TO_METER, Categories[i], 1.5f, limbStrength, suddenDeath ? 0.001f : 1f, i % 2 == 1, new Color(i * 60, i * 60, i * 60), Players[i], player);
                    player[i].LockControl = true;
                }
            }

            for (int i = 0; i < info.Length; i++)
                info[i] = new PlayerValues(lives);

            timed = minutes > 0;
            millisLeft = (minutes == 0 ? -1 : minutes * 60000);
            startPause = 180;
            gameOver = false;
            winners = new List<int>();
            winSticks = new List<StickFigure>();
        }
コード例 #6
0
ファイル: SingleMap.cs プロジェクト: TadCordle/Project-Jack
        public SingleMap(Color[] colors, string mapString, float gravity, int lives, float limbStrength, bool suddenDeath, bool traps, bool longRange, bool bots)
        {
            world = new World(new Vector2(0, gravity));
            this.limbStrength = limbStrength;
            this.suddenDeath = suddenDeath;

            MapData data = Map.LoadMap(world, mapString);
            background = data.background;
            walls = data.walls;
            spawnPoints = data.spawnPoints;
            Vector3[] ammoPoints = data.ammoPoints;
            ammo = new TrapAmmo[ammoPoints.Length];
            if (traps)
                for (int i = 0; i < ammoPoints.Length; i++)
                    ammo[i] = new TrapAmmo(world, new Vector2(ammoPoints[i].X, ammoPoints[i].Y) * MainGame.PIXEL_TO_METER, (int)ammoPoints[i].Z);
            music = data.music;
            MediaPlayer.Play(music);
            foreground = data.foreground;

            StickFigure.AllowTraps = traps;
            StickFigure.AllowLongRange = longRange;

            player = new StickFigure[bots ? 4 : colors.Length];
            this.info = new PlayerValues[bots ? 4 : colors.Length];
            enemies = new List<StickFigure>();
            toRemove = new Dictionary<StickFigure, int>();
            temp = new List<StickFigure>();
            winStick = null;

            for (int i = 0; i < colors.Length; i++)
                if (colors[i] != null)
                {
                    player[i] = new LocalPlayer(world, spawnPoints[i] * MainGame.PIXEL_TO_METER, Category.Cat1, 1.5f, limbStrength, suddenDeath ? 0.001f : 1f, false, colors[i], Players[i]);
                    player[i].LockControl = true;
                }

            for (int i = 0; i < info.Length; i++)
                info[i] = new PlayerValues(lives);

            maxEnemies = player.Length;
            kills = 0;
            millis = 0;
            startPause = 180;
            gameOver = false;
            enterPressed = true;
        }
コード例 #7
0
ファイル: SingleMap.cs プロジェクト: TadCordle/Badminton
        public SingleMap()
        {
            world = new World(new Vector2(0, 9.8f)); // That'd be cool to have gravity as a map property, so you could play 0G levels

            testFigure = new LocalPlayer(world, new Vector2(480 * MainGame.PIXEL_TO_METER, 480 * MainGame.PIXEL_TO_METER), Category.Cat1, Color.Red);
            dummyFigure = new StickFigure(world, new Vector2(150 * MainGame.PIXEL_TO_METER, 900 * MainGame.PIXEL_TO_METER), Category.Cat2, Color.Green);
            weapon = new TestWeapon(world, new Vector2(640 * MainGame.PIXEL_TO_METER, 480 * MainGame.PIXEL_TO_METER));
            walls = new List<Wall>();
            walls.Add(new Wall(world, 480 * MainGame.PIXEL_TO_METER, 700 * MainGame.PIXEL_TO_METER, 960 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 16 * MainGame.PIXEL_TO_METER, 540 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 1080 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 960 * MainGame.PIXEL_TO_METER, 1040 * MainGame.PIXEL_TO_METER, 1920 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1500 * MainGame.PIXEL_TO_METER, 960 * MainGame.PIXEL_TO_METER, 870 * MainGame.PIXEL_TO_METER, 120 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1450 * MainGame.PIXEL_TO_METER, 865 * MainGame.PIXEL_TO_METER, 248 * MainGame.PIXEL_TO_METER, 98 * MainGame.PIXEL_TO_METER, -(float)Math.PI / 6));
            walls.Add(new Wall(world, 1735 * MainGame.PIXEL_TO_METER, 840 * MainGame.PIXEL_TO_METER, 402 * MainGame.PIXEL_TO_METER, 176 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1904 * MainGame.PIXEL_TO_METER, 540 * MainGame.PIXEL_TO_METER, 32 * MainGame.PIXEL_TO_METER, 1080 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1859 * MainGame.PIXEL_TO_METER, 717 * MainGame.PIXEL_TO_METER, 109 * MainGame.PIXEL_TO_METER, 123 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1600 * MainGame.PIXEL_TO_METER, 570 * MainGame.PIXEL_TO_METER, 122 * MainGame.PIXEL_TO_METER, 104 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 1320 * MainGame.PIXEL_TO_METER, 487 * MainGame.PIXEL_TO_METER, 113 * MainGame.PIXEL_TO_METER, 107 * MainGame.PIXEL_TO_METER, 0.0f));
            walls.Add(new Wall(world, 180 * MainGame.PIXEL_TO_METER, 300 * MainGame.PIXEL_TO_METER, 41 * MainGame.PIXEL_TO_METER, 370 * MainGame.PIXEL_TO_METER, 0.0f));

            bulletList = new List<Bullet>();
        }