Exemplo n.º 1
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);
        }
Exemplo n.º 2
0
        public void update(Map map, Sound sound, Shot shots, List <Entity> entityList, List <Animate> animationList)
        {
            base.accelerate = 1;
            base.decelerate = 2;
            base.fall       = 1f;
            base.jump       = 20;
            base.vitesseMax = 3;
            base.fallMax    = 20;

            //
            base.accelerateInit = accelerate;
            base.decelerateInit = decelerate;
            base.fallInit       = fall;
            base.jumpInit       = jump;
            base.vitesseMaxInit = vitesseMax;
            base.fallMaxInit    = fallMax;
            Collisions collision = new Collisions(this, map, sound, shots, map.itemList, entityList, animationList);

            Physics.Fall(this);
            if (direction != Direction.stop)
            {
                if (speed.X == 0 && direction == Direction.left)
                {
                    Physics.MoveRight(this);
                    direction = Direction.right;
                }
                if (speed.X == 0 && direction == Direction.right)
                {
                    Physics.MoveLeft(this);
                    direction = Direction.left;
                }
            }
            String nul = "";

            collision.DoMove(ref nul);
        }
Exemplo n.º 3
0
        // vas a la ligne 298!
        public static void IACheckEvents(Enemy Glandu, IAType IAType, Map map, List <Player> PlayerTab, Shot shots, List <Vector3> destructTile, int host, Sound sound, List <Entity> entityList, List <Animate> animationList, List <ParticleEngine> particle, ContentManager Content, List <Enemy> Enemys, List <Vector2> exploseReseau)
        {
            Collisions collision = new Collisions(Glandu, map, sound, shots, map.itemList, entityList, animationList);

            if (IAcollideIA(Glandu, Enemys))
            {
                if (Glandu.id % 4 == 1)
                {
                    IAMoveRight(Glandu);
                }
                if (Glandu.id % 4 == 2)
                {
                    IAMoveLeft(Glandu);
                }
                if (Glandu.id % 4 == 3)
                {
                    IAJump(Glandu);
                }
            }
            Physics.Fall(Glandu);
            if (IAType == IAType.Survival)
            {
                IASurvival(Glandu, (Player)PlayerTab[0], 400, shots, 0, 0, sound, Content, map, Enemys);
                Glandu.iaType = IAType.patr_Snd;
            }

            if (IAType == IAType.SnD)
            {
                IA.IAModSnDestroy(Glandu, PlayerTab[PlayerNearest(Glandu, PlayerTab, 100000, 0)], 380, shots, 0, 0, sound);
            }
            String msg = "";

            collision.DoMove(ref msg);

            IAHole(Glandu, map);

            msg = "";

            collision.IsShooted(Glandu, shots, sound, particle);
            collision.ValideTire(map, shots, destructTile, particle, Content, exploseReseau);

            if ((collision.haut))// || collision.haut || collision.uR))// && Math.Abs(Glandu.pos.X - PlayerTab[0].pos.X) < 300 && Math.Abs(Glandu.pos.Y - PlayerTab[0].pos.Y) < 300)//(Glandu.direction == Direction.Gauche || Glandu.direction == Direction.Droite))
            {
                IAShoot(Glandu, shots, 0, 0, (int)Glandu.position.X, (int)Glandu.position.Y - 100, sound);
            }
            if (collision.droite || collision.gauche)
            {
                IAJump(Glandu);
            }

            if (IAType == IAType.patr_SndHigh)
            {
                if (Math.Abs(PlayerTab[0].position.X - Glandu.position.X) < 1000)
                {
                    IA.IAModSnDestroy(Glandu, PlayerTab[0], 700, shots, 0, 0, sound);
                }
                else
                {
                    IAModPatrouille(Glandu, (int)map.IASpawnList[Glandu.id - 100].X - 450, (int)map.IASpawnList[Glandu.id - 100].X + 450);
                }
            }
            if (IAType == IAType.patr_SndHigh)
            {
                if (Math.Abs(PlayerTab[0].position.X - Glandu.position.X) < 1000)
                {
                    IA.IAModSnDestroy(Glandu, PlayerTab[0], 700, shots, 0, 0, sound);
                }
                else
                {
                    IAModPatrouille(Glandu, (int)map.IASpawnList[Glandu.id - 100].X - 200, (int)map.IASpawnList[Glandu.id - 100].X + 200);
                }
            }
            if (IAType == IAType.patr_Snd)
            {
                if (Math.Abs(PlayerTab[0].position.X - Glandu.position.X) < 1000)
                {
                    IA.IAModSnDestroy(Glandu, PlayerTab[0], 700, shots, 0, 0, sound);
                }
                else
                {
                    IAModPatrouille(Glandu, (int)map.IASpawnList[Glandu.id - 100].X - 300, (int)map.IASpawnList[Glandu.id - 100].X + 300);
                }
            }
            if (IAType == IAType.random)
            {
                IARandomMove(Glandu);
            }

            Glandu.animation.SetCorrectSprite(Glandu);

            if (Glandu.direction == Direction.left)
            {
                Glandu.currentWeapon.Update(Glandu, Math.PI, null);
            }
            else
            {
                Glandu.currentWeapon.Update(Glandu, 0, null);
            }
        }