Method: Actor#on_destroy

Defined in:
lib/fantasy/actor.rb

#on_destroy(&block) ⇒ Object

The block to be executed before the Actor is destroyed

Examples:

Executes when destroyed

actor = Actor.new("image")
actor.on_destroy do
  Sound.play("explosion")
end


448
449
450
# File 'lib/fantasy/actor.rb', line 448

def on_destroy(&block)
  @on_destroy_callback = block
end