public override void LoadContent(ContentManager content)
        {
            var map = Map;

            var platform = PlatformFactory.Get(EStructureType.Blank, ref mDirector, 3000, 3000);

            GameScreen.AddObject(platform);

            var platform2 = PlatformFactory.Get(EStructureType.Blank, ref mDirector, 3000, 2500);

            GameScreen.AddObject(platform2);

            var road = new Road(platform, platform2, ref mDirector);

            GameScreen.AddObject(road);

            var platform3 = PlatformFactory.Get(EStructureType.Blank, ref mDirector, 2700, 2700);

            GameScreen.AddObject(platform3);

            var road2 = new Road(platform2, platform3, ref mDirector);

            GameScreen.AddObject(road2);

            var road3 = new Road(platform, platform3, ref mDirector);

            GameScreen.AddObject(road3);


            var settler = new Settler(new Vector2(3000, 3200), Camera, ref mDirector, GameScreen, Ui);

            GameScreen.AddObject(settler);
        }
Exemple #2
0
        // method that produces enemy military units when called up by the Ki
        internal EnemyUnit SpawnEnemy(EEnemyType type, Camera camera, Map.Map map, GameScreen gameScreen)
        {
            EnemyUnit enemyUnit;

            switch (type)
            {
            case EEnemyType.Attack:
                enemyUnit = new EnemyUnit(new Vector2(Center.X + 100, Center.Y + 30), camera, ref mDirector);
                break;

            case EEnemyType.Defend:
                enemyUnit = new EnemyHeavy(new Vector2(Center.X + 100, Center.Y + 30), camera, ref mDirector);
                break;

            case EEnemyType.Scout:
                enemyUnit = new EnemyFast(new Vector2(Center.X + 100, Center.Y + 30), camera, ref mDirector);
                break;

            default:
                throw new ArgumentOutOfRangeException(nameof(type), type, null);
            }

            gameScreen.AddObject(enemyUnit);
            return(enemyUnit);
        }
Exemple #3
0
        public override void LoadContent(ContentManager content)
        {
            Camera.CenterOn(new Vector2(MapConstants.MapWidth / 2 * 1, MapConstants.MapHeight / 2 * 1));

            var map = Map;

            GlobalVariables.FowEnabled = false;

            var platform = PlatformFactory.Get(EStructureType.Barracks, ref mDirector, 3000, 3000);

            var rnd = new Random();

            for (var i = 0; i < 1000; i++)
            {
                var x = rnd.Next(MapConstants.MapWidth);
                var y = rnd.Next(MapConstants.MapHeight);

                if (!Singularity.Map.Map.IsOnTop(new Vector2(x, y)))
                {
                    i--;
                    continue;
                }
                GameScreen.AddObject(new MilitaryUnit(new Vector2(x, y), Camera, ref mDirector));
            }

            GameScreen.AddObject(platform);
        }
Exemple #4
0
        public override void LoadContent(ContentManager content)
        {
            //INGAME OBJECTS INITIALIZATION ===================================================

            //SetUnit
            var settler = new Settler(new Vector2(2900, 3200), Camera, ref mDirector, GameScreen, Ui);

            Camera.CenterOn(settler.AbsolutePosition);

            GameScreen.AddObject(settler);

            GameScreen.AddObject(new Puddle(new Vector2(3300, 2500), ref mDirector));
            GameScreen.AddObject(new Puddle(new Vector2(4500, 2700), ref mDirector, false));
        }
Exemple #5
0
        private void StandardInitialization(ContentManager content)
        {
            //Load stuff
            var platformConeTexture  = content.Load <Texture2D>("Cones");
            var platformCylTexture   = content.Load <Texture2D>("Cylinders");
            var platformBlankTexture = content.Load <Texture2D>("PlatformBasic");
            var platformDomeTexture  = content.Load <Texture2D>("Dome");
            var mapBackground        = content.Load <Texture2D>("backgroundGrid");
            var libSans12            = content.Load <SpriteFont>("LibSans12");

            PlatformFactory.Init(platformConeTexture, platformCylTexture, platformDomeTexture, platformBlankTexture, libSans12);
            StructureLayoutHolder.Initialize(ref mDirector);

            //Map related stuff
            Camera = new Camera(mGraphics.GraphicsDevice, ref mDirector);
            mFow   = new FogOfWar(Camera, mGraphics.GraphicsDevice);

            var map = new Map.Map(mapBackground, 60, 60, mFow, Camera, ref mDirector);

            Map = map;
            var milUnitSheet  = content.Load <Texture2D>("UnitSpriteSheet");
            var milGlowSheet  = content.Load <Texture2D>("UnitGlowSprite");
            var genUnitSprite = content.Load <Texture2D>("GenUnit");

            MilitaryUnit.mMilSheet      = milUnitSheet;
            MilitaryUnit.mGlowTexture   = milGlowSheet;
            GeneralUnit.mGenUnitTexture = genUnitSprite;

            mDirector.GetMilitaryManager.SetMap(ref map);

            //INITIALIZE SCREENS
            GameScreen = new GameScreen(mGraphics.GraphicsDevice, ref mDirector, Map, Camera, mFow);
            Ui         = new UserInterfaceScreen(ref mDirector, Map, Camera, mScreenManager);
            mDirector.GetUserInterfaceController.ControlledUserInterface = Ui; // the UI needs to be added to the controller

            // the input manager keeps this from not getting collected by the GC
            mDebugscreen = new DebugScreen((StackScreenManager)mScreenManager, Camera, Map, ref mDirector);

            mDirector.GetInputManager.FlagForAddition(this);

            if (Ai != null)
            {
                GameScreen.AddObject(Ai);
            }
        }
Exemple #6
0
        public override void LoadContent(ContentManager content)
        {
            var settler = new Settler(new Vector2(2900, 3200), Camera, ref mDirector, GameScreen, Ui);

            GameScreen.AddObject(settler);

            Camera.CenterOn(settler.AbsolutePosition);

            var milunitList = new List <MilitaryFast>(6);

            for (var i = 0; i < 6; i++)
            {
                milunitList.Add(new MilitaryFast(new Vector2(3000 + (i > 2 ? 100 : 0), 3000 + (i % 3) * 50), Camera, ref mDirector));
            }

            GameScreen.AddObjects(milunitList);


            // add a puddle && rock
            GameScreen.AddObject(new Puddle(new Vector2(3300, 2500), ref mDirector));
            GameScreen.AddObject(new Puddle(new Vector2(3300, 2700), ref mDirector, false));
            GameScreen.AddObject(new Rock(new Vector2(5000, 5000), ref mDirector));
        }