Exemplo n.º 1
0
        public void useWarthog(Perso perso, Vehicule vehicule, Controles controles)
        {
            perso.image            = TexturesGame.itemTab[2];
            perso.vitesseMax       = 10;
            perso.currentItem.name = "Hornet";

            if (controles.StayRight())
            {
                Physics.MoveRight(perso);
                Physics.MoveRight(perso);
                Physics.MoveRight(perso);
            }
            else if (controles.StayLeft())
            {
                Physics.MoveLeft(perso);
                Physics.MoveLeft(perso);
                Physics.MoveLeft(perso);
            }
            else
            {
                Physics.Deccelarate(perso);
            }

            if (controles.StayUp() && perso.speed.Y >= -10)
            {
                perso.speed.Y = (-1f + perso.speed.Y) - 1.2f;
            }

            if (controles.StayDown() && !controles.Up() && perso.speed.Y >= -20)
            {
                perso.speed.Y = -1f;
                //if(Perso.speed.X<0)
            }
        }
Exemplo n.º 2
0
        public void useBanshee(Perso Perso, Vehicule vehicule, Controles controles)
        {
            Perso.image                 = TexturesGame.itemTab[1];
            Perso.vitesseMax            = 15;
            Perso.currentWeapon.isOnMap = false;
            //Perso.currentWeapon = Perso.currentItem.VehicleGun[0];
            Perso.currentItem.name = "Banshee";

            if (controles.StayRight())
            {
                Perso.speed.X = 9;
            }
            else if (controles.StayLeft())
            {
                Perso.speed.X = -9;
            }
            else
            {
                if (Perso.direction == Direction.left)
                {
                    Perso.speed.X = -3;
                }
                if (Perso.direction == Direction.right)
                {
                    Perso.speed.X = 3;
                }
            }

            if (controles.StayUp() && Perso.speed.Y >= -10)
            {
                Perso.speed.Y = (-1f + Perso.speed.Y) - 1.2f;
            }

            if (controles.StayDown() && !controles.Up() && Perso.speed.Y >= -20)
            {
                Perso.speed.Y = -0.8f;
                //if(Perso.speed.X<0)
            }
            if (controles.Action())
            {
                int i = Perso.currentItem.VehicleGun.IndexOf(Perso.currentWeapon);
                if (Perso.currentItem.VehicleGun.Count <= i + 1)
                {
                    Perso.currentWeapon = Perso.currentItem.VehicleGun[0];
                }
                else
                {
                    Perso.currentWeapon = Perso.currentItem.VehicleGun[i + 1];
                }
            }
        }
Exemplo n.º 3
0
        public void useHornet(Perso Perso, Vehicule vehicule, Controles controles)
        {
            Perso.currentWeapon.isOnMap = false;
            Perso.image            = TexturesGame.itemTab[0];
            Perso.vitesseMax       = 20;
            Perso.currentItem.name = "Hornet";
            for (int i = 0; i < Perso.objetTouched.Count; i++)
            {
                if (Perso.objetTouched[i].GetType() == typeof(Enemy))
                {
                    //Enemy eny =(Enemy)Perso.objetTouched[i];
                    //  ((Enemy)(Perso.objetTouched[i])).pV = 0;
                }
            }
            if (controles.StayRight())
            {
                Perso.speed.X = 13;
            }
            else if (controles.StayLeft())
            {
                Perso.speed.X = -13;
            }
            else
            {
                Physics.Deccelarate(Perso);
            }

            if (controles.StayUp() && Perso.speed.Y >= -10)
            {
                Perso.speed.Y = (-1f + Perso.speed.Y) - 1.2f;
            }

            if (controles.StayDown() && !controles.Up() && Perso.speed.Y >= -20)
            {
                Perso.speed.Y = -1f;
                //if(Perso.speed.X<0)
            }
            if (controles.Action())
            {
                int i = Perso.currentItem.VehicleGun.IndexOf(Perso.currentWeapon);
                if (Perso.currentItem.VehicleGun.Count <= i + 1)
                {
                    Perso.currentWeapon = Perso.currentItem.VehicleGun[0];
                }
                else
                {
                    Perso.currentWeapon = Perso.currentItem.VehicleGun[i + 1];
                }
            }
        }
Exemplo n.º 4
0
        public static void CheckEvents(Player player, Map map, List <Vector3> destructTile, int host, Shot shots, Sound sound, ref String msg, Controles controles, List <Entity> entityList, List <Animate> animationList, List <ParticleEngine> particle, ContentManager Content, List <Vector2> explosereseau)
        {
            Collisions collision = new Collisions(player, map, sound, shots, map.itemList, entityList, animationList);

            KeyEvents(player, map, controles, sound);
            if (controles.StayDown())
            {
                player.fallMax = player.fallMaxInit;
            }
            AllTimeEvents(player);

            collision.DoMove(ref msg);

            collision.IsShooted(player, shots, sound, particle);

            collision.ValideTire(map, shots, destructTile, particle, Content, explosereseau);

            player.animation.SetCorrectSprite(player);
        }