Esempio n. 1
0
        public void StartLevel()
        {
            Console.WriteLine("Menu: StartLevel");

            game.Services.RemoveService(typeof(MenuSoundManager));
            game.Services.RemoveService(typeof(MenuInputController));

            IGameLogicInputService inputController = Game.Services.GetService(typeof(IGameLogicInputService)) as IGameLogicInputService;

            inputController.start();

            this.menuInputController.pause();

            InputManager inputManager = Game.Services.GetService(typeof(InputManager)) as InputManager;

            inputManager.start();

            if (!hudExists)
            {
                hudExists = true;
                Game.Components.Add(new HUDPuzzleBobble(this.game));
            }
            renderer.start();



            Game.Components.Remove(this);
            this.Dispose();
            PuzzleBobble.setup_random_level();
            Casanova.commit_variable_updates();
            gameLogic.start();
        }
Esempio n. 2
0
        public override void Initialize()
        {
            //      Console.WriteLine("GameLogic: Initialize");

            this.gameLogicInputController = Game.Services.GetService(typeof(IGameLogicInputService)) as IGameLogicInputService;
            //if (cameraInput != null)
            //{
            if (this.gameLogicInputController == null)
            {
                this.gameLogicInputController = new GameLogicInputController(this.game);
                Game.Components.Add((GameLogicInputController)this.gameLogicInputController);
            }
            gameLogicInputController.changedCamera += this.OnCameraMoved;//(Camera.CameraTransformations t, float dt) => this.OnCameraMoved(t, dt);
            gameLogicInputController.gamePaused    += this.OnGamePaused;

            //}
            Game.Exiting += new EventHandler <EventArgs>(Game_Exiting);
            PuzzleBobble.setup_random_level();
            //  Casanova.commit_variable_updates();
            //_level();
            base.Initialize();
        }