예제 #1
0
        public MainGameArea(int gameAreaBlockWidth, int gameAreaBlockHeight)
        {
            //setup main game area
            gameAreastartingPosition = new Vector2(600, 100);
            gameAreaBlocksAcross = 30;
            gameAreaBlocksDown = 20;

            this.gameAreaBlockWidth = gameAreaBlockWidth;
            this.gameAreaBlockHeight = gameAreaBlockHeight;

            gameArea = new Block[gameAreaBlocksAcross, gameAreaBlocksDown];

            gameAreaBound0 = gameArea.GetUpperBound(0);
            gameAreaBound1 = gameArea.GetUpperBound(1);

            for (int i = 0; i <= gameAreaBound0; i++)
            {
                for (int j = 0; j <= gameAreaBound1; j++)
                {

                    Vector2 position = new Vector2(gameAreastartingPosition.X + i * gameAreaBlockWidth, gameAreastartingPosition.Y + j * gameAreaBlockHeight);
                    gameArea[i, j] = new Block(position);

                }
            }
            active = false;

            buildings = new List<Building>();

            armyUnits = new List<ArmyUnit>();

            randomNumber = new Random();

            armyAtThisSector = 0;
            people = 0;

            moveArmy = false;
        }
예제 #2
0
        public UserInterface(int uiAreaBlockWidth, int uiAreaBlockHeight)
        {
            //setup UI area
            uiAreastartingPosition = new Vector2(80, 300);
            uiAreaBlocksAcross = 10;
            uiAreaBlocksDown = 15;

            this.uiAreaBlockWidth = uiAreaBlockWidth;
            this.uiAreaBlockHeight = uiAreaBlockHeight;

            uiArea = new Block[uiAreaBlocksAcross, uiAreaBlocksDown];

            uiAreaBound0 = uiArea.GetUpperBound(0);
            uiAreaBound1 = uiArea.GetUpperBound(1);

            for (int i = 0; i <= uiAreaBound0; i++)
            {
                for (int j = 0; j <= uiAreaBound1; j++)
                {

                    Vector2 position = new Vector2(uiAreastartingPosition.X + i * uiAreaBlockWidth, uiAreastartingPosition.Y + j * uiAreaBlockHeight);
                    uiArea[i, j] = new Block(position);

                }
            }
            personIcon = new Vector2(uiAreastartingPosition.X+(40*4), uiAreastartingPosition.Y+(40*5));
            rightArrowIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 5), uiAreastartingPosition.Y + (40 * 5));
            armyIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 6), uiAreastartingPosition.Y + (40 * 5));
            leftArrowIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 3), uiAreastartingPosition.Y + (40 * 5));
            researchIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 2), uiAreastartingPosition.Y + (40 * 5));
            downArrowIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 400), uiAreastartingPosition.Y + (40 * 300));
            rockIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 400), uiAreastartingPosition.Y + (40 * 300));
            personWithRockIconPosition = new Vector2(uiAreastartingPosition.X + (40 * 400), uiAreastartingPosition.Y + (40 * 300));

            aUIState = uiState.main;
        }
예제 #3
0
        private void InitilaizeMapArea()
        {
            //setup map area
            mapAreaStartingPosition = new Vector2(100, 100);
            mapAreaBlocksAcross = 3;
            mapAreaBlocksDown = 3;

            mapAreaBlockWidth = gameArt.TileTexture.Width;
            mapAreaBlockHeight = gameArt.TileTexture.Height;

            MapArea = new Block[mapAreaBlocksAcross, mapAreaBlocksDown];

            mapAreaBound0 = MapArea.GetUpperBound(0);
            mapAreaBound1 = MapArea.GetUpperBound(1);

            for (int i = 0; i <= mapAreaBound0; i++)
            {
                for (int j = 0; j <= mapAreaBound1; j++)
                {

                    Vector2 position = new Vector2(mapAreaStartingPosition.X + i * mapAreaBlockWidth, mapAreaStartingPosition.Y + j * mapAreaBlockHeight);
                    MapArea[i, j] = new Block(position);

                }
            }
        }