public void PickUp(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable = null) { if (gameAction is PickUp || gameAction is LayDown) { gameAction.Resolve(new GameActorPosition(this, position, LayerType.Object), atlas, tilesetTable); } }
public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable) { var doorOpened = new SimpleDoorOpened(tilesetTable); bool added = atlas.Add(new GameActorPosition(doorOpened, position, LayerType.OnGroundInteractable)); if (added) { atlas.Remove(new GameActorPosition(this, position, LayerType.ObstacleInteractable)); } }
public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable) { var interact = gameAction as Interact; if (interact != null) { Ignite(atlas, tilesetTable); } }
public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable = null) { UsePickaxe action = gameAction as UsePickaxe; if (action != null) { UsePickaxe usePickaxe = action; Health -= usePickaxe.Damage; } if (Health <= 0f) atlas.ReplaceWith(new GameActorPosition(this, position, LayerType.ObstacleInteractable), new DestroyedWall(tilesetTable)); }
public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable = null) { if (!(gameAction is UsePickaxe)) return; UsePickaxe usePickaxe = (UsePickaxe)gameAction; if (Math.Abs(usePickaxe.Damage) < 0.00001f) return; if (usePickaxe.Damage >= 1.0f) { atlas.ReplaceWith(new GameActorPosition(this, position, LayerType.ObstacleInteractable), new DestroyedWall(tilesetTable)); return; } atlas.ReplaceWith(new GameActorPosition(this, position, LayerType.ObstacleInteractable), new DamagedWall(usePickaxe.Damage, tilesetTable, Vector2I.Zero)); }
public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable) { gameAction.Resolve(new GameActorPosition(this, position, LayerType.ObstacleInteractable), atlas, tilesetTable); }
public void PickUp(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable) { gameAction.Resolve(new GameActorPosition(this, position, LayerType.OnGroundInteractable), atlas, tilesetTable); }