Beispiel #1
0
 public Removing(GameEntity entity)
 {
     entity_ = entity;
     currentTime_ = 0;
     processTime_ = 0.5f;
     bar_ = new UI.ProgressBar(50);
 }
Beispiel #2
0
 public Removing(GameEntity entity)
 {
     entity_      = entity;
     currentTime_ = 0;
     processTime_ = 0.5f;
     bar_         = new UI.ProgressBar(50);
 }
Beispiel #3
0
 public Player(GameplayScreen g, PlayerIndex n, Color c, Vector2 d)
 {
     gScreen = g;
     PI = n;
     myColor = c;
     darkColor = Color.Lerp(myColor, Color.Black, 0.3f);
     display = d;
     progressBar = new UI.ProgressBar(g.ScreenManager.Game, new Rectangle((int)d.X, (int)d.Y, 300, 16));
     progressBar.maximum = MAX_POWER;
     progressBar.fillColor = Color.White;
     progressBar.borderColorInner = GameplayScreen.OCEAN;
     progressBar.backgroundColor = GameplayScreen.OCEAN;
     progressBar.target = POW_COST[(int)curPower];
 }
Beispiel #4
0
        public void CreateMap()
        {
            screenWidth = GameStateManagementGame.width;
            screenHeight = GameStateManagementGame.height;

            noone = new Player(this, PlayerIndex.One, GRAY, new Vector2(0, 0));

            if (PlayersMenuScreen.player1 == PlayersMenuScreen.PlayerType.Human)
                players.Add(new Player(this, PlayerIndex.One, BLUE, new Vector2(50, 10)));
            else if (PlayersMenuScreen.player1 == PlayersMenuScreen.PlayerType.AI)
                players.Add(new AI(this, PlayerIndex.One, BLUE, new Vector2(50, 10)));

            if (PlayersMenuScreen.player2 == PlayersMenuScreen.PlayerType.Human)
                players.Add(new Player(this, PlayerIndex.Two, YELLOW, new Vector2(930, 10)));
            else if (PlayersMenuScreen.player2 == PlayersMenuScreen.PlayerType.AI)
                players.Add(new AI(this, PlayerIndex.Two, YELLOW, new Vector2(930, 10)));

            if (PlayersMenuScreen.player3 == PlayersMenuScreen.PlayerType.Human)
                players.Add(new Player(this, PlayerIndex.Three, GREEN, new Vector2(50, 652)));
            if (PlayersMenuScreen.player3 == PlayersMenuScreen.PlayerType.AI)
                players.Add(new AI(this, PlayerIndex.Three, GREEN, new Vector2(50, 652)));

            if (PlayersMenuScreen.player4 == PlayersMenuScreen.PlayerType.Human)
                players.Add(new Player(this, PlayerIndex.Four, ORANGE, new Vector2(930, 652)));
            if (PlayersMenuScreen.player4 == PlayersMenuScreen.PlayerType.AI)
                players.Add(new AI(this, PlayerIndex.Four, ORANGE, new Vector2(930, 652)));

            curPlayer = players[random.Next(players.Count)];

            progressBar = new UI.ProgressBar(ScreenManager.Game, new Rectangle((screenWidth - 300)/2, 50, 300, 16));
            progressBar.maximum = (float)deployFreq;
            progressBar.fillColor = Color.White;
            progressBar.backgroundColor = Color.Black;

            if (OptionsMenuScreen.currentMap != OptionsMenuScreen.Map.World)
            {
                CreateGrid();
            }
            else
            {
                CreateWorld();
            }

            // we have to initialze the hover territory
            Dictionary<string, Country>.Enumerator e = territories.GetEnumerator();
            e.MoveNext();
            foreach (Player p in players)
            {
                p.hover = e.Current.Value;
            }

            //foreach (KeyValuePair<string, Country> c in territories)
            //{
            //    Player owner = c.Value.getOwner();
            //    bool frontLines = false;
            //    foreach (Country n in c.Value)
            //    {
            //        if (n.getOwner() != owner)
            //            frontLines = true;
            //    }
            //    if (frontLines)
            //        c.Value.setStrength(4);
            //}

            if (OptionsMenuScreen.currentPlacement == OptionsMenuScreen.Placement.Random)
                AssignRandomly();
            else
                AssignManually();

            pruneMovements();
        }