Esempio n. 1
0
        private void DrawDeepSpaceObjects(SpriteBatch spriteBatch)
        {
            foreach (GameObjectOverworld obj in deepSpaceGameObjects)
            {
                obj.Draw(spriteBatch);
            }

            for (int i = 0; i < deepSpaceGameObjects.Count; i++)
            {
                if (CollisionDetection.IsRectInRect(Game.player.Bounds, deepSpaceGameObjects[i].Bounds))
                {
                    if (!burnOutEnding.Activated)
                    {
                        if (deepSpaceGameObjects[i].Class == "Planet")
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(Game, spriteBatch, deepSpaceGameObjects[i].Bounds);
                            Game.helper.DisplayText("Press 'Enter' to enter planetary orbit.");
                        }

                        else if (deepSpaceGameObjects[i].Class == "Station")
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(Game, spriteBatch, deepSpaceGameObjects[i].Bounds);
                            Game.helper.DisplayText("Press 'Enter' to dock with station.");
                        }
                    }
                }

                foreach (GameObjectOverworld obj in effectsObjects)
                {
                    obj.Draw(spriteBatch);
                }
            }
        }
Esempio n. 2
0
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if ((ObjectiveIndex == 2) &&
                CollisionDetection.IsRectInRect(Game.player.Bounds, allyShipRectangle))
            {
                CollisionHandlingOverWorld.DrawRectAroundObject(Game, spriteBatch, allyShipRectangle);
                Game.helper.DisplayText("Press 'Enter' to speak with the Rebel fleet");
            }
        }
        public override void Draw(SpriteBatch spriteBatch)
        {
            base.Draw(spriteBatch);

            if (!started 
                && GameStateManager.currentState.Equals("OverworldState") 
                && CollisionDetection.IsRectInRect(game.player.Bounds, escortDataCapsule.ShipToDefend.Bounds))
            {
                CollisionHandlingOverWorld.DrawRectAroundObject(game, spriteBatch, escortDataCapsule.ShipToDefend.Bounds);
                game.helper.DisplayText("Press 'Enter' to talk to freighter captain..");
            }
        }
Esempio n. 4
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            foreach (GameObjectOverworld obj in gameObjects)
            {
                obj.Draw(spriteBatch);
            }

            for (int i = 0; i < gameObjects.Count; i++)
            {
                if (CollisionDetection.IsRectInRect(game.player.Bounds, gameObjects[i].Bounds))
                {
                    if (!game.stateManager.overworldState.IsBurnOutEndingActivated)
                    {
                        if (gameObjects[i].Class == "Planet")
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(game, spriteBatch, gameObjects[i].Bounds);
                            game.helper.DisplayText("Press 'Enter' to enter planetary orbit.");
                        }

                        else if (gameObjects[i].Class == "Station")
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(game, spriteBatch, gameObjects[i].Bounds);
                            game.helper.DisplayText("Press 'Enter' to dock with station.");
                        }

                        else if (gameObjects[i] is Beacon && !game.player.HyperspeedOn)
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(game, spriteBatch, gameObjects[i].Bounds);
                            if (!((Beacon)gameObjects[i]).IsActivated)
                            {
                                game.helper.DisplayText("Press 'Enter' to activate beacon.");
                            }

                            else
                            {
                                game.helper.DisplayText("Press 'Enter' to interact with beacon.");
                            }
                        }

                        else if (gameObjects[i] is SubInteractiveObject)
                        {
                            CollisionHandlingOverWorld.DrawRectAroundObject(game, spriteBatch, gameObjects[i].Bounds);
                            game.helper.DisplayText("Press 'Enter' to investigate.");
                        }
                    }
                }
            }
        }
Esempio n. 5
0
        protected override void Initialize()
        {
            CreateDirectories();
            SetAvailableResolutions();
            GameStarted = false;

            settingsFile = new SaveFile(this);
            settingsFile.Load(SaveFilePath, "settings.ini");

            Vector2 defaultResolution = GetDefaultResolution();

            resolution = new Vector2(settingsFile.GetPropertyAsFloat("visual", "resolutionx", defaultResolution.X),
                                     settingsFile.GetPropertyAsFloat("visual", "resolutiony", defaultResolution.Y));
            ScreenSize = new Point((int)resolution.X, (int)resolution.Y);

            random = new Random(DateTime.Now.Millisecond);

            showFPS = settingsFile.GetPropertyAsBool("visual", "showfps", false);

            graphics.PreferredBackBufferWidth  = (int)resolution.X;
            graphics.PreferredBackBufferHeight = (int)resolution.Y;
            if (IsDualMonitor())
            {
                graphics.IsFullScreen = false;
            }
            else
            {
                graphics.IsFullScreen = settingsFile.GetPropertyAsBool("visual", "fullscreen", true);
            }
            graphics.SynchronizeWithVerticalRetrace = true;

            // Uncomment to unlock FPS
            //IsFixedTimeStep = false;
            //graphics.SynchronizeWithVerticalRetrace = false;

            graphics.ApplyChanges();

            CenterScreenWindow();

            IsMouseVisible = settingsFile.GetPropertyAsBool("game options", "showmouse", true);

            menuBGController = new MenuBackdropController(this);
            menuBGController.Initialize();

            musicManager = new MusicManager(this);
            musicManager.Initialize();

            soundEffectsManager = new SoundEffectsManager(this);
            soundEffectsManager.Initialize();

            fontManager = new FontManager(this);
            fontManager.Initialize();

            ControlManager.LoadControls(settingsFile);

            spriteSheetOverworld       = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/smallObjectSpriteSheet"));
            spriteSheetVerticalShooter = new Sprite(Content.Load <Texture2D>("Vertical-Sprites/shooterSheet"));
            messageBoxSpriteSheet      = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/messageBoxSpriteSheet"));
            spriteSheetItemDisplay     = new Sprite(Content.Load <Texture2D>("itemVisualSheet"));
            beaconMenuSprite           = new Sprite(Content.Load <Texture2D>("Overworld-Sprites/BeaconMenu"));
            CollisionHandlingOverWorld.LoadLineTexture(this);

            shipInventoryManager = new ShipInventoryManager(this);
            shipInventoryManager.Initialize();

            statsManager = new StatsManager(this);
            statsManager.Initialize();

            player = new PlayerOverworld(this, spriteSheetOverworld);
            player.Initialize();

            beaconMenu = new BeaconMenu(this, beaconMenuSprite);
            beaconMenu.Initialize();

            stateManager = new GameStateManager(this);
            stateManager.Initialize();

            missionManager = new MissionManager(this);
            missionManager.Initialize();

            tutorialManager = new TutorialManager(this);
            tutorialManager.Initialize();
            tutorialManager.TutorialsUsed = settingsFile.GetPropertyAsBool("game options", "tutorials", true);

            shopManager = new ShopManager();

            saveFile = new SaveFile(this);

            Portrait.InitializePortraitSpriteSheet(this);
            popupHandler = new PopupHandler(this, messageBoxSpriteSheet);
            popupHandler.Initialize();

            helper = new HelperBox(this);

            ShopManager.SetShopUpdateTime(ShopManager.PRESET_SHOPTIME);

            base.Initialize();
        }