Exemplo n.º 1
0
 public static void ExecuteAction(Player player, Tile tile, ReactionType action)
 {
     Element tileType = tile.ElementType;
       if (Controller.Reactions.ContainsKey(tileType))
       {
     if (Controller.Reactions[tileType].Types.Contains(action))
     {
       // Execute Action
       switch (action)
       {
     case ReactionType.Platform:
       break;
     case ReactionType.HorizontalPlatform:
       break;
     case ReactionType.VerticalPlatform:
       break;
     case ReactionType.ComplexPlatform:
       break;
     case ReactionType.Hurt:
       player.Hurt(-player.Direction);
       break;
     case ReactionType.HurtFromFront:
       player.Hurt(-player.Direction);
       break;
     case ReactionType.HurtFromBack:
       player.Hurt(-player.Direction);
       break;
     case ReactionType.HurtFromAbove:
       player.Hurt(-player.Direction);
       break;
     case ReactionType.HurtFromBelow:
       player.Hurt(-player.Direction);
       break;
     case ReactionType.Bounce:
       player.Jump(1.0f);
       break;
     case ReactionType.Jump:
       player.Jump(1.0f);
       break;
     case ReactionType.HighJump:
       player.Jump(2.0f);
       break;
     case ReactionType.Collect:
       break;
     case ReactionType.Push:
       break;
     case ReactionType.Destroy:
       break;
     default:
       break;
       }
     }
       }
 }
Exemplo n.º 2
0
 private void RemoveFlaggedTiles()
 {
     if (RemoveTile != null)
       {
     LevelMap.Tiles.Remove(RemoveTile);
     RemoveTile = null;
       }
 }
Exemplo n.º 3
0
 public void TileToRemove(Tile tile)
 {
     RemoveTile = tile;
 }
Exemplo n.º 4
0
 internal void Carry(Tile tileToPush)
 {
     XState = HorizontalState.Carrying;
 }
Exemplo n.º 5
0
 internal void ReleaseLocks()
 {
     LockToHorizontalTile = false;
       LockToVerticalTile = false;
       LockToComplexTile = false;
       LockOnTileTile = null;
 }
Exemplo n.º 6
0
 internal void Release(Tile tileToPush)
 {
     XState = HorizontalState.Stopped;
 }
Exemplo n.º 7
0
        internal void LockToTile(Tile tile)
        {
            MovementType movementType = tile.Movement.Type;

              switch (movementType)
              {
            case MovementType.Static:
              return;
            case MovementType.Horizontal:
              LockToHorizontalTile = true;
              break;
            case MovementType.Vertical:
              LockToVerticalTile = true;
              break;
            case MovementType.HalfCircle:
              LockToComplexTile = true;
              break;
              }

              LockOnTileTile = tile;
        }