AINE: Accelerated Interactive Narrator Engine
  • Download
  • References
  • Games
  • Wiki
  • Facebook Twitter
  • Name

    if

  • Examples

    Player: {
    prevRoom:

    Event: Enter_Room{
    // Checks of the room player entered is actually locked
    // If the room is locked, moves player back to the previous room and displays some text

    if (currentRoom().isLocked){
    moveTo(prevRoom)
    display("That room is locked!)
    }
    }

    Event: Leave_Room{
    prevRoom = currentRoom()
    // Sets the value of prevRoom to the current room before the plater leaves
    }
    }
  • Description

    Declares a block of code to be read when the if statement is true. If the if statement evaluates to false the statements within the block are not executed.

    This can be extended with the else statement to have something happen when the if statement is false.
  • Syntax

    • if (expression) { statements }
    • if (expression) { statements } else if (expression) { statements }
  • Related

    • ?: (conditional)

    • else

  • Contact
  • Terms of Use
  • GitHub
  • Drakkashi.com

The copyright of all images rendered by me goes to their respective owners.
© 2008 Daniel Svejstrup Christensen