Class Door


public class Door extends BlockEntity
A locked door: solid until the player touches it holding the key it names, which is used up.
  • Constructor Details

    • Door

      public Door(String id, int x, int y, int w, int h, String key)

      Creates a door.

      Parameters
      • id: the id
      • x: left, fixed point, on a tile edge
      • y: top, fixed point, on a tile edge
      • w: width, whole tiles, fixed point
      • h: height, whole tiles, fixed point
      • key: the key name that opens it
  • Method Details

    • getKey

      public String getKey()

      The key that opens the door.

      Returns

      the key name

    • getPhase

      public int getPhase()
      Description copied from class: LevelEntity

      A small number the view reads to pick a frame: open or closed, lit or not, how cracked. The default is 0.

      Returns

      the visual phase

      Overrides:
      getPhase in class LevelEntity
    • onAdded

      public void onAdded(PlatformWorld world)
      Description copied from class: LevelEntity

      Called once when the entity is added to a world, before the first step: the place to write solid cells. The default does nothing.

      Parameters
      • world: the world
      Overrides:
      onAdded in class LevelEntity
    • onTouch

      public void onTouch(PlatformWorld world, Actor c)
      Description copied from class: LevelEntity

      Called each tick a living actor overlaps the entity.

      Parameters
      • world: the world
      • c: the actor
      Overrides:
      onTouch in class LevelEntity