Class: Rm (of Obj)

The Rm class is the class for rooms. Each room in your game is built of an instance of this class..

Properties

  • scripts
  • number
  • timer
  • keep
  • initialized
  • picture
  • style
  • horizon
  • controls
  • north
  • east
  • south
  • west
  • curPic
  • picAngle
  • vanishingX
  • vanishingY

Methods

  • void init()

    Sets up the room object.

    sets up the number and controls properties, and the global variable gPicAngle to the picAngle property. It draws it's picture if specified. It then sets up the ego's position based on the edge hit. Finally, it's sets it's edge hit to EDGE_NONE.

  • void doit()

    If the script property is set, it calls the script's doit() method. It checks if an edge has been hit, and if it has, calls newRoom for it's specified script (north,east,west, south).

  • void dispose()

    Disposes it's controls, then itself.

  • bool handleEvent(heapPtr pEvent)

    It calls it's super's handleEvent() method. If it is TRUE, or the controls property is set, it calls the control's handleEvent() method. It then returns whether pEvent has been claimed or not.

  • void newRoom(number newRoomNum)

    Changes the room.

    It prepares the regions for a new room, then sets the global gRoomNumber to newRoomNum and calls the game class' newRoom() method.

  • void setRegions(number(s) scriptNumbers)

    Adds the specified script numbers to the regions list and initializes them.

  • void setFeatures(heapPtr(s) features)

    Adds the specified features to the features list.

  • void setLocales(number(s) scriptNumbers)

    Adds the specified script numbers to the locales list and initializes them.

  • void drawPic(number picNum[, number picAni])

    Draws the specified picture.

    It disposes all the addToPic elements, sets the global gOverlay to -1 and sets it's curPic property to picNum. If picAni is specified, it draws the picture, clearing the screen first with the picAni animation and gDefaultPalette as it's palette. Otherwise, if the style property is not -1, it draws the picture, clearing the screen first with the style animation and gDefaultPalette as it's palette. Otherwise, if the style property is -1, it draws the picture, clearing the screen first with gDefaultPicAni as it's animation and gDefaultPalette as it's palette.

  • void overlay(number picNum[, number picAni])

    Draws the specified picture over the current picture.

    It sets the global gOverlay to picNum. If picAni is specified, it draws the picture, without clearing the screen first with the picAni animation and gDefaultPalette as it's palette. Otherwise, if the style property is not -1, it draws the picture, without clearing the screen first with the style animation and gDefaultPalette as it's palette. Otherwise, if the style property is -1, it draws the picture, without clearing the screen first with gDefaultPicAni as it's animation and gDefaultPalette as it's palette.