User (of Obj)

class User

Defined in User.sc.

This class manages user input. The main method of interest here is canControl().

Example usage:

(if (send gUser:canControl())
        // The user is in control...
)

Properties

Defined in User:

Property Description
alterEgo  
input  
controls  
prevDir  
x  
y  
mapKeyToDir  
curEvent  

Methods

init()
doit()
canControl()
Returns:TRUE if the user is currently controlling the game, otherwise FALSE.
canControl(shouldControl)
Parameters:shouldControl (boolean) – TRUE if the user should be in control, otherwise FALSE.

Important

Generally, (send gGame::handsOff()) and (send gGame::handsOn()) should be used to give and take away user control of the game.

handleEvent(pEvent)
canInput()
Returns:TRUE if input is enabled, FALSE otherwise.
canInput(shouldInput)
Parameters:shouldInput (boolean) – TRUE if input should be enabled, otherwise FALSE.