Beispiel #1
0
 public ModelManager(Game game, ScreenManager screenManager)
     : base(game)
 {
     this.game = game;
     this.screenManager = screenManager;
     this.texManager = ((Spectrum)game).texManager;
     this.buttonHandler = new ButtonHandler(game);
 }
Beispiel #2
0
        public Bubble(Model model, Game game, Camera camera, OctTree octTree, Vector3 startPosition, Vector3 startDirection, Vector3 startUp, BasicCube[] worldMap, ScreenManager screenManager)
            : base(model, game)
        {
            this.octTree = octTree;
            //  shadow = game.Content.Load<Effect>(@"Shader/Shadow");
            movementHandler = new MovementAndInputHandler(game, this);
            collisionHandler = new CollisionHandler(game, this, screenManager, worldMap);
            effect = ((Spectrum)game).effect;
            texture = screenManager.texManager.getBubbleTexture();
            this.camera = camera;
            this.currentPosition = startPosition;
            this.game = game;
            this.bubble = model;
            this.startPosition = startPosition;
            this.currentPosition = startPosition;
            movementHandler.setStartValues(startPosition, Vector3.Backward, Vector3.Up, Quaternion.Identity, SpectrumEnums.Orientation.posY);

            this.soundManager = ((Spectrum)game).soundManager;

            this.screenManager = screenManager;
            this.screenManager.setPlayer(this);
        }
Beispiel #3
0
        //================== Music Settings Bars =====================//
        public PopUp(Game game, ScreenManager screenManager, Bubble player, SpectrumEnums.popUpId style = SpectrumEnums.popUpId.custom, string headline = "", string text = "")
        {
            this.position = new Vector2(game.Window.ClientBounds.Width / 2f, game.Window.ClientBounds.Height / 2f);
            this.game = game;
            this.texManager = ((Spectrum)game).texManager;
            this.screenManager = screenManager;
            this.player = player;
            this.headlineFont = screenManager.modelManager.getHeadlineFont();
            this.textFont = screenManager.modelManager.getTextFont();
            this.buttonHandler = screenManager.modelManager.buttonHandler;

            popUpTexture = texManager.getUITexture(style);
            currentStyle = style;
            switch (style)
            {
                case SpectrumEnums.popUpId.custom:
                    this.headline = headline;
                    this.text = text;
                    break;
                case SpectrumEnums.popUpId.win:
                    this.headline = "Congratulations!";
                    this.text = "You beat the level! \n You can go on with the next level \nor play again.";
                    break;
                case SpectrumEnums.popUpId.lose:
                    this.headline = "Game over";
                    this.text = "You lose, try again!";
                    break;
            }
            origin = new Vector2(popUpTexture.Width / 2f, popUpTexture.Height / 2f);
            center = new Vector2(position.X + recPosition.Width / 2f, position.Y + recPosition.Height / 2f);
            recPosition = new Rectangle((int)position.X - (int)origin.X, (int)position.Y - (int)origin.Y, popUpTexture.Width, popUpTexture.Height);
            setButtons();
        }
Beispiel #4
0
        protected override void Initialize()
        {
            currentGameState = SpectrumEnums.GameState.Start;
            effect = Content.Load<Effect>(@"Shader/Shader");
            grayEffect = Content.Load<Effect>(@"Shader/Grayscale");
            loadFromSaveFile();

            gameAnalytics = new GameAnalytics();
            this.texManager = new TextureManager(this);
            Components.Add(texManager);
            screenManager = new ScreenManager(this);
            Components.Add(screenManager);
            camera = new Camera(this, new Vector3(0, 10, 5), new Vector3(0, 8, 3), new Vector3(0, 5, 0));
            Components.Add(camera);
            modelManager = new ModelManager(this, screenManager);
            Components.Add(modelManager);
            screenManager.setModelManager(modelManager);
            soundManager = new SoundManager(this);
            Components.Add(soundManager);
            // set render target in order to be able to apply post processing effets
            renderTarget = new RenderTarget2D(graphics.GraphicsDevice,
                GraphicsDevice.PresentationParameters.BackBufferWidth,
                GraphicsDevice.PresentationParameters.BackBufferHeight,
                true, SurfaceFormat.Color, DepthFormat.Depth24Stencil8);
            this.IsMouseVisible = false;
            base.Initialize();
        }