Exemplo n.º 1
0
        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;
        }
Exemplo n.º 2
0
 public void AttachToTile(Tile mapTile)
 {
     LocationResolver = new FixedLocationResolver(mapTile);
 }