The Ego class is for the main character
in the game. It is just like any other actor's class, but improved to
handle everything realted to the ego. Examples of egos are Larry in Leisure
Suit Larry and Roger Wilco in Space Quest.
Properties
- y
- x
- z
- heading
- yStep
- view
- loop
- cel
- priority
- underBits
- signal
- nsTop
- nsLeft
- nsBottom
- nsRight
- lsTop
- lsLeft
- lsBottom
- lsRight
- brTop
- brLeft
- brBottom
- brRight
- cycleSpeed
- script
- cycler
- timer
- illegalBits
- xLast
- yLast
- xStep
- moveSpeed
- blocks
- baseSetter
- mover
- looper
- viewer
- avoider
- edgeHit
Methods
-
void init() |
Sets up the Ego class.
It calls the super's init(), then,
if a cycler has not been specified, sets it to Walk.
|
-
void doit() |
Calls it's super's doit() method,
then figures out which edge is hit (EDGE_NONE, EDGE_TOP, EDGE_LEFT,
EDGE_BOTTOM, EDGE_RIGHT)
|
-
bool handleEvent(heapPtr
pEvent) |
Ego's event handler.
It calls the super's handleEvent()
method. If the event is not claimed, it handles the ego's movement.
This is the handler for moving the ego to where you click, or
moving it when you press the arrow keys, or use the joystick.
|
-
void get(number(s)
items) |
Use this to get inventory items.
|
-
void put(number
item[, heapPtr newOwner]) |
Puts the specified inventory somewhere.
If newOwner is specified, it puts it in newOwner, otherwise,
it set's it's owner to -1.
|
-
bool has(number(s)
items) |
Returns whether or not ego has
the specified item in the inventory.
|
|