TilePort.java 524 B

12345678910111213141516171819202122232425
  1. package pathgame.tilemap;
  2. import pathgame.gameplay.Keys;
  3. import pathgame.gameplay.Player;
  4. /** Class for ports to have special behaviour.
  5. *
  6. * @author kajetan
  7. */
  8. public class TilePort extends Tile
  9. {
  10. public TilePort()
  11. {
  12. super(2, 0.0f, (pa) -> 0, false, false, TileType.PORT, false, false, TileRenderType.NORMAL);
  13. }
  14. @Override
  15. public void isStandingOn(Player p, TileMap map, int x, int y)
  16. {
  17. if(Keys.BOAT_KEY.getTime() == 1)
  18. {
  19. p.switchSailing();
  20. }
  21. }
  22. }