User (of Object)

class User

Defined in User.sc.

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

Example usage:

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

Properties

Inherited from Object:

Property Description
name  

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, (gGame handsOff:) and (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.