Example #1
0
        void OnCollision(CollisionMsg msg)
        {
            Entity target = msg.First == Owner ? msg.Second : msg.First;
            Recruter recruter = target.GetComponent<Recruter>();
            if (recruter == null)
                return;

            Target = recruter.Owner;
        }
Example #2
0
 void OnCollision(CollisionMsg message)
 {
     if (message.First.GetComponent<MainCharacter>() != null)
     {
         message.First.GetComponent<MainCharacter>().Dispose();
     }
     else if (message.Second.GetComponent<MainCharacter>() != null)
     {
         message.First.GetComponent<MainCharacter>().Dispose();
     }
 }
Example #3
0
        void OnCollision(CollisionMsg msg)
        {
            if (m_TimeBeforeNextPlay > 0)
                return;

            SoundEffect effect = m_Sound.Get();

            effect.Play();
            m_TimeBeforeNextPlay = (float)effect.Duration.TotalSeconds;
            m_Playing = true;
        }
Example #4
0
        void OnCollision(CollisionMsg msg)
        {
            if (msg.First.Name == "Eleve" || msg.Second.Name == "Eleve")
            {
                Game2D.gameHud.lives--;
                if (Game2D.gameHud.lives <= 0)
                {
                    Game2D.gameHud.lives = 0;
                }
            }

            //Game2D.gameHud.score++;
        }
Example #5
0
 void OnCollision(CollisionMsg msg)
 {
     //logique de collision
 }
Example #6
0
        void OnCollision(CollisionMsg msg)
        {
            Entity target = msg.First == Owner ? msg.Second : msg.First;

            Owner.Dispose();
        }