Ejemplo n.º 1
0
        private void LoadLevel(int lvl)
        {
            switch (lvl)
            {

                case (0):

                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(320, 720) * ScaleFactor;
                    target1.position = new Vector2(50, 50);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;

                   



                    break;


                case(1):

                     player1.isScoring = false;
                    player1.score = 0;
                   // player1.position = new Vector2(200, 700);
                    player1.ball.Position = new Vector2(400, 50)*ScaleFactor;
 

                    player1.isFlicked = false;

                    target1.position = new Vector2(50, 600);
                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;
                    





                    break;

                case (2):
                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(200, 720)*ScaleFactor;
                    target1.position = new Vector2(200, 50);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;

                    obz1 = new ObstacleObject(Content.Load<Texture2D>("Sprites/Brick_200x50_Side"));
                    obz1.isAlive = true;

                    obz1.wall = obz1.CreateWall(world, ScaleFactor);
                    obz1.wall.Position  = new Vector2(200, 600)*ScaleFactor;
                    break;


                case (3):
                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(10, 400) * ScaleFactor;
                    target1.position = new Vector2(300, 700);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;
                    target1.position = new Vector2(300, 500);

                   //world.DestroyBody(obz1.wall);

                    obz2 = new ObstacleObject(Content.Load<Texture2D>("Sprites/Brick_600x150_Up"));
                    obz2.isAlive = true;

                    obz2.wall = obz2.CreateWall(world, ScaleFactor);
                    obz2.wall.Position = new Vector2(200, 400) * ScaleFactor;
                    break; 

                case(4):
                    this.Exit();
                    break;
            }

        }
Ejemplo n.º 2
0
        private void LoadLevel(int lvl)
        {
            switch (lvl)
            {

                case (0):

                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(320, 720) * ScaleFactor;
                    target1.position = new Vector2(50, 50);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;

                    break;

                case(1):

                     player1.isScoring = false;
                    player1.score = 0;
                   // player1.position = new Vector2(200, 700);
                    player1.ball.Position = new Vector2(400, 50)*ScaleFactor;

                    player1.isFlicked = false;

                    target1.position = new Vector2(50, 600);
                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;

                    break;

                case (2):
                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(200, 720)*ScaleFactor;
                    target1.position = new Vector2(200, 50);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;

                    obz1 = new ObstacleObject(Content.Load<Texture2D>("Sprites/Brick_200x50_Side"));
                    obz1.isAlive = true;

                    obz1.wall = obz1.CreateWall(world, ScaleFactor);
                    obz1.wall.Position  = new Vector2(200, 600)*ScaleFactor;
                    break;

                case (3):
                    player1.isScoring = false;
                    player1.score = 0;
                    player1.ball.Position = new Vector2(10, 400) * ScaleFactor;
                    target1.position = new Vector2(300, 700);
                    player1.isFlicked = false;

                    target1.isAlive = true;
                    target1.isInsideMe = false;
                    target1.isTouchingMe = false;
                    target1.position = new Vector2(300, 500);

                   //world.DestroyBody(obz1.wall);

                    obz2 = new ObstacleObject(Content.Load<Texture2D>("Sprites/Brick_600x150_Up"));
                    obz2.isAlive = true;

                    obz2.wall = obz2.CreateWall(world, ScaleFactor);
                    obz2.wall.Position = new Vector2(200, 400) * ScaleFactor;
                    break;

                case(4):
                    this.Exit();
                    break;
            }
        }