예제 #1
0
        public Asteroid(Game1 Game, Sprite spriteSheet, Vector2 coordinates) :
            base(Game, spriteSheet)
        {
            this.coordinates = coordinates;
            position         = MathFunctions.CoordinateToPosition(coordinates);

            this.angle = (float)(MathFunctions.GetExternalRandomDouble() * 2 * Math.PI);
        }
예제 #2
0
        public override void Initialize()
        {
            sprite   = spriteSheet.GetSubSprite(new Rectangle(80, 1400, 92, 81));
            position = MathFunctions.CoordinateToPosition(new Vector2(3737, 4242));
            name     = "Space Duck";
            base.Initialize();

            String activationText = "The spaceduck speaks.#\"You have travelled very far to reach me.\"#\"Hereby, I will grant you the ability to travel with ludicrous speed.\"#\"You activate this by pressing the button found in my name.\"#\"Goodbye.\"";

            overworldEvent = new EnableHyperSpeedAtSpaceDuckOE(Game, activationText, this);
        }
예제 #3
0
        public override void Initialize()
        {
            sprite   = spriteSheet.GetSubSprite(new Rectangle(342, 871, 93, 93));
            position = MathFunctions.CoordinateToPosition(new Vector2(1500, 2000));
            name     = "Information Station";

            base.Initialize();

            isHidden = true;

            overworldEvent = new DisplayTextOE("The station seems to be abandoned. There is a strange air about it though.");
        }
예제 #4
0
        public override void Initialize()
        {
            sprite = spriteSheet.GetSubSprite(new Rectangle(724, 1075, 54, 55));


            position = MathFunctions.CoordinateToPosition(new Vector2(1817, 135));
            name     = "TestAsteroid1";

            base.Initialize();
            //String encounterText = "Pirates! Let's root em out!";
            //String winText = "We scared them of, for now..";
            //String loseText = "They are too strong. Let's come back later.";
            //List<Item> rewards = new List<Item>();
            //rewards.Add(new BasicLaserWeapon(Game, ItemVariety.Regular));
            //overworldEvent = new LevelOE(encounterText, "sub1", 100, rewards, winText, loseText);

            overworldEvent = new PirateEncounterOE();
        }
예제 #5
0
        public override void Initialize()
        {
            base.Initialize();

            name = "Sector X";

            spriteSheet = new Sprite(game.Content.Load <Texture2D>("Overworld-Sprites/SectorXSpriteSheet"), null);

            spaceRegionArea = new Rectangle(85000, 85000, 30000, 30000);
            Vector2 offset = new Vector2(spaceRegionArea.X, spaceRegionArea.Y);

            sectorXStar = new SectorXStar(game, spriteSheet);
            sectorXStar.Initialize();

            // Sub-interactive objects
            soelara            = new Soelara(game, spriteSheet);
            fortrun            = new Fortrun(game, spriteSheet);
            lavis              = new Lavis(game, spriteSheet);
            informationStation = new InformationStation(game, spriteSheet);
            fortrunStation2    = new FortrunStation2(game, spriteSheet);
            lonelyAsteroid     = new LonelyAsteroid(game, spriteSheet);
            damagedShip        = new DamagedShip(game, new Sprite(game.Content.Load <Texture2D>("Overworld-Sprites/MissionObjectSpriteSheet"), null));
            spaceDuck          = new SpaceDuck(game, spriteSheet);

            var rebelAsteroidFieldGenerator   = new RebelOutpostAsteroidField(game, spriteSheet);
            var sunAsteroidBeltGenerator      = new SunAsteroidBelt(game, spriteSheet);
            var lavisAsteroidBeltGenerator    = new LavisAsteroidBelt(game, spriteSheet);
            var westernAsteroidFieldGenerator = new WesternAsteroidField(game, spriteSheet);
            var telmunAsteroidFieldGenerator  = new TelmunAsteroidBelt(game, spriteSheet);

            // For testing purposes // Jakob 150623
            //var testFieldGenerator = new TestingField(game, spriteSheet);
            //subInteractiveObjects.AddRange(testFieldGenerator.GetAsteroids());

            subInteractiveObjects.AddRange(rebelAsteroidFieldGenerator.GetAsteroids());
            subInteractiveObjects.AddRange(sunAsteroidBeltGenerator.GetAsteroids());
            subInteractiveObjects.AddRange(lavisAsteroidBeltGenerator.GetAsteroids());
            subInteractiveObjects.AddRange(westernAsteroidFieldGenerator.GetAsteroids());
            subInteractiveObjects.AddRange(telmunAsteroidFieldGenerator.GetAsteroids());

            subInteractiveObjects.Add(soelara);
            subInteractiveObjects.Add(fortrun);
            subInteractiveObjects.Add(lavis);
            subInteractiveObjects.Add(fortrunStation2);
            subInteractiveObjects.Add(lonelyAsteroid);
            subInteractiveObjects.Add(damagedShip);
            subInteractiveObjects.Add(spaceDuck);
            subInteractiveObjects.Add(informationStation);

            foreach (var obj in subInteractiveObjects)
            {
                obj.Initialize();
            }

            // Planets
            highfence   = new Highfence(game, spriteSheet, offset);
            newNorrland = new NewNorrland(game, spriteSheet, offset);
            peye        = new Peye(game, spriteSheet, offset);
            highfence.Initialize();
            newNorrland.Initialize();
            peye.Initialize();

            // Stations
            lavisStation    = new LavisStation(game, spriteSheet, lavis.position);
            soelaraStation  = new SoelaraStation(game, spriteSheet, soelara.position);
            fortrunStation1 = new FortrunStation1(game, spriteSheet, fortrun.position);
            lavisStation.Initialize();
            soelaraStation.Initialize();
            fortrunStation1.Initialize();

            // Shops
            highfenceShop = new HighfenceShop(game, spriteSheet, highfence.position);
            fortrunShop   = new FortrunShop(game, spriteSheet, fortrun.position);
            peyeShop      = new PeyeShop(game, spriteSheet, peye.position);
            highfenceShop.Initialize();
            fortrunShop.Initialize();
            peyeShop.Initialize();

            // Training area
            var outpostSpriteSheet = game.stateManager.overworldState.outpostSpriteSheet;

            trainingArea2 = new TrainingArea2(game, outpostSpriteSheet, MathFunctions.CoordinateToPosition(new Vector2(-1680, 10)));
            trainingArea2.Initialize();

            highfenceBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                         "Highfence Beacon", highfence.position + new Vector2(300, 250));
            highfenceBeacon.Initialize();

            fortrunBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                       "Fortrun Beacon", fortrun.position + new Vector2(350, 100));
            fortrunBeacon.Initialize();

            peyeBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                    "Peye Beacon", peye.position + new Vector2(-200, -450));
            peyeBeacon.Initialize();

            lavisBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                     "Lavis Beacon", lavis.position + new Vector2(150, 350));
            lavisBeacon.Initialize();

            soelaraBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                       "Soelara Beacon", soelara.position + new Vector2(300, 350));
            soelaraBeacon.Initialize();

            newNorrlandBeacon = new Beacon(game, spriteSheet, new Rectangle(588, 844, 100, 100), new Rectangle(487, 844, 100, 100),
                                           "New Norrland Beacon", newNorrland.position + new Vector2(-300, 100));
            newNorrlandBeacon.Initialize();

            game.stateManager.overworldState.AddBeacon(highfenceBeacon);
            game.stateManager.overworldState.AddBeacon(fortrunBeacon);
            game.stateManager.overworldState.AddBeacon(peyeBeacon);
            game.stateManager.overworldState.AddBeacon(lavisBeacon);
            game.stateManager.overworldState.AddBeacon(soelaraBeacon);
            game.stateManager.overworldState.AddBeacon(newNorrlandBeacon);

            AddGameObject(sectorXStar);

            AddGameObject(highfence);
            AddGameObject(newNorrland);
            AddGameObject(peye);

            AddGameObject(lavisStation);
            AddGameObject(fortrunStation1);
            AddGameObject(soelaraStation);
            AddGameObject(trainingArea2);

            AddGameObject(highfenceShop);
            AddGameObject(fortrunShop);
            AddGameObject(peyeShop);

            AddGameObject(highfenceBeacon);
            AddGameObject(fortrunBeacon);
            AddGameObject(peyeBeacon);
            AddGameObject(lavisBeacon);
            AddGameObject(soelaraBeacon);
            AddGameObject(newNorrlandBeacon);

            foreach (var obj in subInteractiveObjects)
            {
                AddGameObject(obj);
            }
        }