Class Demo.Tic

java.lang.Object
net.mtrop.doom.demo.Demo.Tic
Enclosing class:
Demo

public static class Demo.Tic extends Object
Demo tic abstraction.
  • Field Details

  • Method Details

    • create

      public static Demo.Tic create(int forward, int rightStrafe, int turnLeft, byte action)
      Creates a game tic. Entered values are clamped to the byte range.
      Parameters:
      forward - the forward movement amount (-127 to 127). Negative values = backwards movement.
      rightStrafe - the right strafe movement amount (-127 to 127). Negative values = strafe left.
      turnLeft - the left turn movement amount (-127 to 127, or -32767 to 32767 on long tics). Negative values = turn right.
      action - the action byte.
      Returns:
      a new demo tic.
    • actionButton

      public static byte actionButton(boolean fire, boolean use)
      Returns the action byte for action buttons.
      Parameters:
      fire - true if set, false if not.
      use - true if set, false if not.
      Returns:
      the action byte value.
    • actionButton

      public static byte actionButton(boolean fire, boolean use, boolean changeWeapon, int weapon)
      Returns the action byte for action buttons.
      Parameters:
      fire - true if set, false if not.
      use - true if set, false if not.
      changeWeapon - true if set, false if not.
      weapon - the weapon number.
      Returns:
      the action byte value.
    • actionSave

      public static byte actionSave(int slot)
      Returns the action byte for saving a game.
      Parameters:
      slot - the save slot to save the game to.
      Returns:
      the action byte value.
    • actionLoad

      public static byte actionLoad(int slot)
      Returns the action byte for loading a game.
      Parameters:
      slot - the load slot to load the game from.
      Returns:
      the action byte value.
    • actionPause

      public static byte actionPause()
      Returns:
      the action byte for pressing pause.
    • actionRestart

      public static byte actionRestart()
      Returns:
      the action byte for restarting the map.
    • getForwardMovement

      public int getForwardMovement()
      Returns forward movement units. Negative values are backwards.
      Returns:
      the unit value.
    • getRightStrafe

      public int getRightStrafe()
      Returns right strafe units. Negative values are left strafes.
      Returns:
      the unit value.
    • getTurnLeft

      public int getTurnLeft()
      Returns left turn units. Negative values are right turns.
      Returns:
      the unit value.
    • getAction

      public byte getAction()
      Returns:
      the action bits on this tic.
    • toString

      public String toString()
      Overrides:
      toString in class Object