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