Ejemplo n.º 1
0
 public void Update(GameTime gameTime, Player player)
 {
     centre = new Vector2(player.Hitbox.X + (player.Hitbox.Width / 2), player.Hitbox.Y + (player.Hitbox.Height / 2));
     vecteur = new Vector2(centre.X - resolutionX/2, centre.Y - resolutionY/2);
     transform = Matrix.CreateScale(new Vector3(1,1,0)) *
     Matrix.CreateTranslation(new Vector3(-vecteur.X, -vecteur.Y,0));
 }
        // Constructeur -- -- -- -- -- -- --
        public GameMain()
        {
            // Personnages
            this.LocalPlayer1 = new Player(690, 360, 2);
            this.keyboardPlayer1 = new KeyboardController();
            this.keyboardPlayer1.up = Keys.Up;
            this.keyboardPlayer1.down = Keys.Down;
            this.keyboardPlayer1.left = Keys.Left;
            this.keyboardPlayer1.right = Keys.Right;
            this.keyboardPlayer1.run = Keys.RightShift;
            this.keyboardPlayer1.player = LocalPlayer1;

            this.LocalPlayer2 = new Player(100, 100, 5);
            this.keyboardPlayer2 = new KeyboardController();
            this.keyboardPlayer2.up = Keys.Z;
            this.keyboardPlayer2.down = Keys.S;
            this.keyboardPlayer2.left = Keys.Q;
            this.keyboardPlayer2.right = Keys.D;
            this.keyboardPlayer2.run = Keys.LeftShift;
            this.keyboardPlayer2.player = LocalPlayer2;

            this.Epouventail = new Player(90, 90, 5);
            this.automatedcontrollerEpouventail = new AutomatedController(new int[,] { { 90, 90 }, { 300, 210 }, { 210, 300 } });
            this.automatedcontrollerEpouventail.player = Epouventail;

            this.Epouventail2 = new Player(690, 360, 5);
            this.automatedcontrollerEpouventail2 = new AutomatedController(new int[,] { { 690, 360 }, { 800, 360 }, { 800, 510 }, { 690, 510 } });
            this.automatedcontrollerEpouventail2.player = Epouventail2;
        }