public GameServiceMainGame(GUIManager gameInstance)
        {
            game = gameInstance;

        }
Esempio n. 2
0
        protected override void LoadContent()
        {
            rectangledraw = Content.Load<Texture2D>("white");

            account = new Account();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            spriteBatch2 = new SpriteBatch(GraphicsDevice);
            sf = Content.Load<SpriteFont>("Segoe_UI_9_Regular");
            glowEffect = Content.Load<Effect>("effect1");
            //glowEffect.CurrentTechnique.Passes[0].Apply();


            titlescreen = new Title(this.Content, new System.EventHandler(TitleScreenEvent));

            menuscreen = new Menu(this, graphics, this.Content,
                new System.EventHandler(MenuScreenEvent), account, GraphicsDevice,
                new System.EventHandler(ExitGamePressed));

            overviewScreen = new Overview(this.graphics, this.Content,
                new System.EventHandler(OverviewEscapeToMenu), new System.EventHandler(gamePaused),
                account, new Vector2(0, 0), new EventHandler(SystemSelected), new EventHandler(DayPassed),
                new EventHandler(SystemHovered), new EventHandler(RemoveSystemHovered),
                new EventHandler(UpdateBuildQueue), new EventHandler(UpdatePlanetResources),
                GraphicsDevice, spriteBatch);

            loadingScreen = new Loading(Content, graphics);
            camera = new Camera(GraphicsDevice.Viewport);

            DGUI = new GUIManager(graphics, Content, new EventHandler(ExitGamePressed),
                new EventHandler(OverviewEscapeToMenu), new EventHandler(SaveGamePressed),
                new EventHandler(LoadGamePressed), new EventHandler(overviewScreen.Button1Pressed),
                new EventHandler(ZoomIn), new EventHandler(overviewScreen.ZoomOut),
                new EventHandler(gamePaused), new EventHandler(planetHighlighted),
                new EventHandler(PlanetslistToggled), new EventHandler(SectorChanged),
                new EventHandler(PlanetInfoPressed), account.SaveData,
                new EventHandler(MapSystemSelected), new EventHandler(JumpToSystem),
                new EventHandler(JumpToPlanet), new EventHandler(TaxRateChanged),
                new EventHandler(GameSpeedChanged), new EventHandler(BuildingUpgraded),
                new EventHandler(BuildingDismantled), new EventHandler(AddBuildQueueItem),
                new EventHandler(RemoveBuildQueueItem), GraphicsDevice);

            //account.SaveData.Score = 6;
            //account.SaveData.MapSize = new Vector2(2000, 2000);
            currentscreen = titlescreen; // <= SETTING FIRST SCREEN TO BE SHOWN
                                         //overviewScreen.LoadContent(account, gameDetails);
                                         //DGUI.Init(this, new Point(0,0));
                                         //DGUI.StartKeyBindings();
                                         // REMOVE WHEN REVERTING BACK TO TITLE SCREEN FIRST ^^

            centre.X = 0;
            centre.Y = 0;
            zoom = 1.0f;

            FramesCounter = new FPSCounter(this, spriteBatch, sf);
        }