flatworld.objects.ObjectSpriteUnit Class
Map unit like infantry or worker, usually something with actions or movable. Usually these are extended, depending on the map type. For example you might want to add some click area for these (e.g. hexagon)
Constructor
Methods
addActionType
-
type
Add certain action type. @todo THIS HAS NOT BEEN IMPLEMENTED YET!
Parameters:
-
type
String
addCallbackToAction
-
type
-
cb
Attach callback for the certain action type. @todo THIS HAS NOT BEEN IMPLEMENTED YET!
doAction
-
type
Execute action on units (move, attack etc.). @todo THIS HAS NOT BEEN IMPLEMENTED YET!
Parameters:
-
type
String
dropShadow
()
Attributes
[name]
This is abstract method and needs to be implemented with a plugin. Core module has an implementation for this and if you don't implement your own, I suggest you use it. You can attach any method to object if you wish. Like attack, siege, greet, talk.
Fires event [name]Change
Fires when the value for the configuration attribute [name]
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added:
actions
Object
actions bound to this object. @todo THIS HAS NOT BEEN IMPLEMENTED YET!
Fires event actionsChange
Fires when the value for the configuration attribute actions
is
changed. You can listen for the event using the on
method if you
wish to be notified before the attribute's value has changed, or
using the after
method if you wish to be notified after the
attribute's value has changed.
Parameters:
-
e
EventFacadeAn Event Facade object with the following attribute-specific properties added: