Class: Kawaii::Entity
Direct Known Subclasses
Instance Attribute Summary collapse
-
#flipped_h ⇒ Object
Returns the value of attribute flipped_h.
-
#flipped_v ⇒ Object
Returns the value of attribute flipped_v.
-
#texture ⇒ Object
Returns the value of attribute texture.
Attributes inherited from Node
#children, #gravity, #position, #rotation, #static, #velocity
Instance Method Summary collapse
- #after_update(dt) ⇒ Object
- #before_update(dt) ⇒ Object
- #draw ⇒ Object
-
#initialize(texture) ⇒ Entity
constructor
A new instance of Entity.
Methods inherited from Node
#add_child, #count, #has_children?, #remove_child, #update
Constructor Details
#initialize(texture) ⇒ Entity
Returns a new instance of Entity.
8 9 10 11 12 |
# File 'lib/kawaii/entity.rb', line 8 def initialize texture super() @flipped_v, @flipped_h = false, false @texture = texture end |
Instance Attribute Details
#flipped_h ⇒ Object
Returns the value of attribute flipped_h.
6 7 8 |
# File 'lib/kawaii/entity.rb', line 6 def flipped_h @flipped_h end |
#flipped_v ⇒ Object
Returns the value of attribute flipped_v.
6 7 8 |
# File 'lib/kawaii/entity.rb', line 6 def flipped_v @flipped_v end |
#texture ⇒ Object
Returns the value of attribute texture.
6 7 8 |
# File 'lib/kawaii/entity.rb', line 6 def texture @texture end |
Instance Method Details
#after_update(dt) ⇒ Object
17 18 |
# File 'lib/kawaii/entity.rb', line 17 def after_update dt end |
#before_update(dt) ⇒ Object
14 15 |
# File 'lib/kawaii/entity.rb', line 14 def before_update dt end |
#draw ⇒ Object
20 21 22 23 |
# File 'lib/kawaii/entity.rb', line 20 def draw # TODO: draw flipped v & h @texture.draw_rot(self.position.x, self.position.y, 0, 0) # TODO: rotation end |