Class: Lotu::Actor
Direct Known Subclasses
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
-
#x ⇒ Object
Returns the value of attribute x.
-
#y ⇒ Object
Returns the value of attribute y.
Instance Method Summary collapse
- #dt ⇒ Object
-
#init_behavior ⇒ Object
Meant to be overriden by behaviors.
-
#initialize(opts = {}) ⇒ Actor
constructor
A new instance of Actor.
- #update ⇒ Object
Methods included from Resourceful
Methods included from Drawable
Methods included from Controllable
Methods included from Eventful
Constructor Details
#initialize(opts = {}) ⇒ Actor
Returns a new instance of Actor.
7 8 9 10 11 12 13 14 15 16 |
# File 'lib/lotu/actor.rb', line 7 def initialize(opts={}) super() @x = opts[:x] || 0 @y = opts[:y] || 0 @parent = $window @parent.update_queue << self # Initialize the behaviors included in subclasses init_behavior end |
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
5 6 7 |
# File 'lib/lotu/actor.rb', line 5 def parent @parent end |
#x ⇒ Object
Returns the value of attribute x.
5 6 7 |
# File 'lib/lotu/actor.rb', line 5 def x @x end |
#y ⇒ Object
Returns the value of attribute y.
5 6 7 |
# File 'lib/lotu/actor.rb', line 5 def y @y end |
Instance Method Details
#dt ⇒ Object
18 19 20 |
# File 'lib/lotu/actor.rb', line 18 def dt $window.dt end |
#init_behavior ⇒ Object
Meant to be overriden by behaviors
23 |
# File 'lib/lotu/actor.rb', line 23 def init_behavior;end |
#update ⇒ Object
24 |
# File 'lib/lotu/actor.rb', line 24 def update;end |