private void Ignite(IAtlas atlas, ITilesetTable tilesetTable) { var fireplaceBurning = new FireplaceBurning(tilesetTable, Position); atlas.ReplaceWith(ThisGameActorPosition(LayerType.OnGroundInteractable), fireplaceBurning); atlas.RegisterToAutoupdate(fireplaceBurning); }
public void ObjectDetected(IGameObject gameObject, IAtlas atlas) { if (SomeoneOnTile) { return; } NextUpdateAfter = 60; atlas.RegisterToAutoupdate(this); }
public void ObjectDetected(IGameObject gameObject, IAtlas atlas) { if (m_wasActive) { m_isActive = true; return; } m_isActive = true; NextUpdateAfter = 1; atlas.RegisterToAutoupdate(this); }
public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable) { var avatar = gameObject as IAvatar; if (avatar != null) { avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP; } var forwardMovable = gameObject as IForwardMovable; if (forwardMovable != null) { forwardMovable.ForwardSpeed = 0; } gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One/2; var trapDischarged = new TrapDischarged(tilesetTable, Position); atlas.RegisterToAutoupdate(trapDischarged); atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable), trapDischarged); }
public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable) { var avatar = gameObject as IAvatar; if (avatar != null) { avatar.Energy -= ENERGY_FOR_STEP_ON_TRAP; } var forwardMovable = gameObject as IForwardMovable; if (forwardMovable != null) { forwardMovable.ForwardSpeed = 0; } gameObject.Position = Vector2.Floor(gameObject.Position) + Vector2.One / 2; var trapDischarged = new TrapDischarged(tilesetTable, Position); atlas.RegisterToAutoupdate(trapDischarged); atlas.ReplaceWith(new GameActorPosition(this, new Vector2(Position), LayerType.OnGroundInteractable), trapDischarged); }
public void ObjectDetected(IGameObject gameObject, IAtlas atlas, ITilesetTable tilesetTable) { if(SomeoneOnTile) return; NextUpdateAfter = 60; atlas.RegisterToAutoupdate(this); }