Example #1
0
    static public void UpdateRhino(ref List <Rhinobot> Rhinobots, Rectangle RecUpdate, GameTime gameTime, PlayerSonic Joueur,
                                   ref int RingsPosses, ref int Life, ref Shield Shield, ref Vector2 PosAnimationPlayer,
                                   ref bool AnimalActif, ref AnimationPlayer AnimationPlayer, ref List <Ring> Rings, Random RringsX,
                                   Random RringsY)
    {
        for (int rh = Rhinobots.Count - 1; rh >= 0; rh--)
        {
            if (RecUpdate.Intersects(Rhinobots[rh].RecRhino))
            {
                Rhinobots[rh].Update(gameTime, Joueur, ref RingsPosses, ref Life, ref Shield);
            }
            #region Si rh toucher
            if (Rhinobots[rh].Touched)
            {
                //si saute sur rhino
                if (Rhinobots[rh].Destroy)
                {
                    CodeExclusifSonic.ActivationAnimal(ref PosAnimationPlayer, Rhinobots[rh].Position,
                                                       ref AnimalActif, ref AnimationPlayer);
                    Rhinobots.RemoveAt(rh);
                    continue;
                }

                //si n'a pas checker pour les perte de rings
                #region Perte des rings
                if (!Rhinobots[rh].PerteRingOneCheck)
                {
                    Rhinobots[rh].PerteRingOneCheck = true;
                    CodeExclusifSonic.PerteRing(ref RingsPosses, ref Life, ref Joueur, ref Rings, RringsY, RringsX, ref Shield);
                }

                Rhinobots[rh].Touched = false;
                #endregion
            }


            #endregion
        }
    }
Example #2
0
    static public void UpdateSinge(ref List <SingeArticuler> Singes, Rectangle RecUpdate, GameTime gameTime, PlayerSonic Joueur,
                                   ref int RingsPosses, ref int Life, ref Shield Shield, ref Vector2 PosAnimationPlayer,
                                   ref bool AnimalActif, ref AnimationPlayer AnimationPlayer, ref List <Ring> Rings, Random RringsX,
                                   Random RringsY, ref List <ObjectMapping> TexturesObject)
    {
        for (int s = Singes.Count - 1; s >= 0; s--)
        {
            if (RecUpdate.Intersects((new Rectangle(Singes[s].RecTete.X - 100, Singes[s].RecTete.Y, Singes[s].RecTete.Width + 200, Singes[s].RecTete.Height))))
            {
                Singes[s].Update(gameTime, Joueur.RecPerso);
            }

            if (Singes[s].RecTete.Intersects(Joueur.RecPerso))
            {
                //Si saute sur singe
                if ((Joueur.HasJump || Joueur.EnBoule) && !Joueur.Injure)
                {
                    CodeExclusifSonic.ActivationAnimal(ref PosAnimationPlayer, Singes[s].PositionTete, ref AnimalActif, ref AnimationPlayer);
                    RessourceSonic3.EnnemiItem.Play();
                    TexturesObject.Add(new ObjectMapping(4, Singes[s].PositionArbre));
                    Singes.RemoveAt(s);
                    continue;
                }
            }
            //si a encore une noix
            if (Singes[s].BrasArticuler.Noix.Count != 0)
            {
                //Si noix Intersect joueur
                if (Singes[s].BrasArticuler.Noix[0].RecNoix.Intersects(Joueur.RecPerso))
                {
                    CodeExclusifSonic.PerteRing(ref RingsPosses, ref Life, ref Joueur, ref Rings, RringsY, RringsX, ref Shield);
                    Singes[s].BrasArticuler.Noix.Remove(Singes[s].BrasArticuler.Noix[0]);
                }
            }
        }
    }