Method: Actor#on_after_move

Defined in:
lib/fantasy/actor.rb

#on_after_move(&block) ⇒ Object

The block to be executed after each frame

Examples:

Limit Actor movement horizontally

actor = Actor.new("image")
actor.on_after_move do
  if actor.position.x > 100
    actor.position.x = 100
  end
end


424
425
426
# File 'lib/fantasy/actor.rb', line 424

def on_after_move(&block)
  @on_after_move_callback = block
end