Exemplo n.º 1
0
 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);
     }
 }
Exemplo n.º 2
0
 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));
     }
 }
Exemplo n.º 3
0
        public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable)
        {
            var interact = gameAction as Interact;

            if (interact != null)
            {
                Ignite(atlas, tilesetTable);
            }
        }
Exemplo n.º 4
0
        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));
        }
Exemplo n.º 5
0
        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));
        }
Exemplo n.º 6
0
 public void ApplyGameAction(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable)
 {
     gameAction.Resolve(new GameActorPosition(this, position, LayerType.ObstacleInteractable), atlas, tilesetTable);
 }
Exemplo n.º 7
0
 public void PickUp(IAtlas atlas, GameAction gameAction, Vector2 position, ITilesetTable tilesetTable)
 {
     gameAction.Resolve(new GameActorPosition(this, position, LayerType.OnGroundInteractable), atlas, tilesetTable);
 }