Example #1
0
 protected void initGame()
 {
     board = new BoardGame(this, CurrentLevel);
     CameraHolder.initCamera();
     Components.Add(board);
     BubbleHolder.score = 0;
     isFp = true;
 }
Example #2
0
        protected void handleKeyboard()
        {
            KeyboardState keyState = Keyboard.GetState();

            if (keyState.IsKeyDown(Keys.Escape) && !oldState.IsKeyDown(Keys.Escape))
            {
                this.Exit();
            }
            if (keyState.IsKeyDown(Keys.Left))
            {
                board.changeAngle(-1);
            }
            if (keyState.IsKeyDown(Keys.Right))
            {
                board.changeAngle(1);
            }
            if (keyState.IsKeyDown(Keys.Up) && !oldState.IsKeyDown(Keys.Up))
            {
                board.shoot();
            }

            if (keyState.IsKeyDown(Keys.A))
            {
                CameraHolder.cameraFar.RotateY(Angle.toRadians(5));
            }
            if (keyState.IsKeyDown(Keys.S))
            {
                CameraHolder.cameraFar.MoveForwards(-2);
            }
            if (keyState.IsKeyDown(Keys.D))
            {
                CameraHolder.cameraFar.RotateY(Angle.toRadians(-5));
            }
            if (keyState.IsKeyDown(Keys.W))
            {
                CameraHolder.cameraFar.MoveForwards(2);
            }
            if (keyState.IsKeyDown(Keys.Q))
            {
                BubbleHolder.initGrid(0, 0, 0);
            }
            if (keyState.IsKeyDown(Keys.C) && !oldState.IsKeyDown(Keys.C))
            {
                isFp = !isFp;
                CameraHolder.switchCameras(isFp);
            }

            if (keyState.IsKeyDown(Keys.Enter) && !oldState.IsKeyDown(Keys.Enter))
            {
                proceed();
            }
            if (keyState.IsKeyDown(Keys.R) && !oldState.IsKeyDown(Keys.R))
            {
                changeLevel(CurrentLevel);
            }
            oldState = keyState;
        }