Class: Kawaii::Entity

Inherits:
Node
  • Object
show all
Defined in:
lib/kawaii/entity.rb

Direct Known Subclasses

PhysicsEntity

Instance Attribute Summary collapse

Attributes inherited from Node

#children, #gravity, #position, #rotation, #static, #velocity

Instance Method Summary collapse

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_hObject

Returns the value of attribute flipped_h.



6
7
8
# File 'lib/kawaii/entity.rb', line 6

def flipped_h
  @flipped_h
end

#flipped_vObject

Returns the value of attribute flipped_v.



6
7
8
# File 'lib/kawaii/entity.rb', line 6

def flipped_v
  @flipped_v
end

#textureObject

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

#drawObject



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