public override void Update() { if (Direction == Directions.Left) { MoveLeft(Speed); } if (Direction == Directions.Right) { MoveRight(Speed); } if (Direction == Directions.Up) { MoveUp(Speed); } if (Direction == Directions.Down) { MoveDown(Speed); } List <GEntity> IntersectingEntities = GameLevel.GetIntersectingEntities(this); foreach (GEntity Entity in IntersectingEntities) { if (!Entity.CanBulletPass) { Entity.Damage(BDamage); if (Entity.IsMetallic || Entity.IsBrick) { Remove(Entity); } else { Remove(); } } } List <Player> IntersectingEnemies = GameLevel.GetIntersectingPlayers(this, IntersectionType.BY_DIFF_OWNER); foreach (Player Enemy in IntersectingEnemies) { if ((GameLevel.GetMode() == Modes.TeamDeathmatch || GameLevel.GetMode() == Modes.CaptureFlag) && Player.GetTeamById(Enemy.Id) != Player.GetTeamById(Owner)) { Enemy.Damage(BDamage); if (Player.IsMe(Owner)) { ++GameComponent.Gs.IntStatsHits; if (Enemy.Removed) { Player.IncrementKills(Owner); } } } Remove(Enemy); } List <Bullet> IntersectingBullets = GameLevel.GetIntersectingBullets(this); foreach (Bullet B in IntersectingBullets) { B.Remove(); this.Remove(); } // Dispose the memory if (X <= 0 || Y <= 0 || X >= GameLevel.MAX_LEVEL_WIDTH || Y >= GameLevel.MAX_LEVEL_HEIGHT) { Remove(); } }