Example #1
0
 public override void AffectEnemy(Enemy e, float secondsPassed)
 {
     e.hitBy(hero, DAMAGE_PER_SECOND * secondsPassed);
 }
Example #2
0
        public void collideWith(Enemy e)
        {
            if (e != null)
            {
                if (dying)
                    return;
                e.hitBy(gunPowerup.hero, damage);
                SoundManager.PlaySoundOnce("EnemyHit", playInReverseDuringReverse: true);
                if (phasing)
                    enemiesAlreadyHit.Add(e);
            }

            if (phasing && e == null)
            {
            }
            else
            {
                explosionEmitter.position = position;
                explosionEmitter.particlesEmitted = 0;
                explosionEmitter.active = true;
                trailEmitter.active = false;
            }

            if (!phasing)
            {
                dying = true;
            }
        }