Example #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);
            }
        }
Example #2
0
 public void Add(SimpleLinearExplosion NewObject)
 {
     ExplosionCollisions.Add(NewObject);
 }
Example #3
0
 public HashSet <WorldObject> GetCollidingWorldObjects(SimpleLinearExplosion ActiveExplosion)
 {
     return(WorldCollisions.GetCollidableObjects(ActiveExplosion.Collision));
 }
Example #4
0
 public HashSet <Player> GetCollidingPlayers(SimpleLinearExplosion ActiveExplosion)
 {
     return(PlayerCollisions.GetCollidableObjects(ActiveExplosion.Collision));
 }