Class: Core::Game::MapAnimation

Inherits:
MapObject show all
Defined in:
lib/game/map/map_animation.rb

Constant Summary

Constants inherited from MapObject

Core::Game::MapObject::DELIM

Instance Attribute Summary

Attributes inherited from MapObject

#dx, #dy, #follow, #name, #properties, #through, #tx, #ty, #x, #y, #z

Instance Method Summary collapse

Methods inherited from MapObject

#dead?, #direction, #do_setup?, #setup, #teleport, #to_save, #trigger, #update_move, #update_trigger

Constructor Details

#initialize(anim, x, y) ⇒ MapAnimation

Returns a new instance of MapAnimation.



6
7
8
9
10
# File 'lib/game/map/map_animation.rb', line 6

def initialize(anim, x, y)
  super(x, y, {})
  @anim = Core.anim(anim)
  @anim.play(x, y, @z)
end

Instance Method Details

#draw(xoff, yoff) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/game/map/map_animation.rb', line 15

def draw(xoff, yoff)
  @anim.x = @x + xoff
  @anim.y = @y + yoff
  @anim.draw
  if @anim.remove?
    @dead = true
  end
end

#updateObject



12
13
# File 'lib/game/map/map_animation.rb', line 12

def update
end