Method: Actor#on_after_move_do

Defined in:
lib/fantasy/actor.rb

#on_after_move_doObject

This method is triggered after each frame

Examples:

Limit Actor movement horizontally

class Player < Actor
  def on_after_move_do
    if @position.x > 100
      @position.x = 100
    end
  end
end


487
488
489
# File 'lib/fantasy/actor.rb', line 487

def on_after_move_do
  instance_exec(&@on_after_move_callback) unless @on_after_move_callback.nil?
end