public override void Update(double currentTime) { if (HasExploded) { return; } if (currentTime - creationTime >= timeToLive) { Explode(currentTime); } var status = LocationResolver.UpdateLocation(currentTime, currentTime - lastTime); if (status != null) { if (status.HaveCollided) { Tile.Object = this; LocationResolver = new FixedLocationResolver(Tile); FloatingObjectRegistry.UnRegister(this); if (status.CollisionObject is Bomb) { (status.CollisionObject as Bomb).Kicked(status.CollisionDirection); } } } lastTime = currentTime; }
public void AttachToTile(Tile mapTile) { LocationResolver = new FixedLocationResolver(mapTile); }