Esempio n. 1
0
        public void Update(GameTime gameTime)
        {
            SecondsBeforeExplosion -= gameTime.ElapsedGameTime.TotalSeconds;

            if (SecondsBeforeExplosion <= 0)
            {
                Owner.Remove(this);
                SimpleLinearExplosion ExplosionUp    = new SimpleLinearExplosion(Owner, CollisionBox.Position, new Vector2(0f, -1f));
                SimpleLinearExplosion ExplosionDown  = new SimpleLinearExplosion(Owner, CollisionBox.Position, new Vector2(0f, 1f));
                SimpleLinearExplosion ExplosionLeft  = new SimpleLinearExplosion(Owner, CollisionBox.Position, new Vector2(-1f, 0f));
                SimpleLinearExplosion ExplosionRight = new SimpleLinearExplosion(Owner, CollisionBox.Position, new Vector2(1f, 0f));

                Owner.Add(ExplosionUp);
                Owner.Add(ExplosionDown);
                Owner.Add(ExplosionLeft);
                Owner.Add(ExplosionRight);
            }
        }
Esempio n. 2
0
 public void Die()
 {
     Owner.Remove(this);
 }