public void CreateExplosion(BombExplosionDTO bombExplosionDTO) { var explosionCoords = bombExplosionDTO.ExplosionCoords; Spawnable explosion = new Spawnable(Bomb.ExplosionSprite, this.Position, this.Rotation) { ProjectileSprite = { Position = CalculateMapPos(explosionCoords[1].X, explosionCoords[0].Y) }, DespawnDrawableAfter = .5f }; // set flame position to bomb // despawn flame after BombTriggers.Add(explosion); for (int i = 0; i < directions.GetLength(0); i++) { int x = explosionCoords[1].X + directions[i][0]; int y = explosionCoords[0].Y + directions[i][1]; while (x != explosionCoords[i].X || y != explosionCoords[i].Y) { explosion = new Spawnable(Bomb.ExplosionSprite, this.Position, this.Rotation) { ProjectileSprite = { Position = CalculateMapPos(x, y) }, DespawnDrawableAfter = .5f }; // set flame position to bomb // despawn flame after BombTriggers.Add(explosion); x += directions[i][0]; y += directions[i][1]; } } }
// Called when a bomb explosion event is sent public void OnBombExplosion(BombExplosionDTO bombExplosionDTO) { _game.mainPlayer.CreateExplosion(bombExplosionDTO); }
public void OnBombExplosion(BombExplosionDTO bombExplosionDTO) { _log.Info("Bomb explosion: " + bombExplosionDTO.ToString()); _client.OnBombExplosion(bombExplosionDTO); }