Skip to content

Instantly share code, notes, and snippets.

@HimeWorks
Created April 6, 2015 23:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HimeWorks/fa30c5e6d575e055e4f6 to your computer and use it in GitHub Desktop.
Save HimeWorks/fa30c5e6d575e055e4f6 to your computer and use it in GitHub Desktop.
EventBuilder: process_method example
class Game_Interpreter
def ev_test
event = Event.new(3, 21)
event.character_name = "actor1"
$game_map.add_event(event)
# Hold a reference to the interpreter
int = self
event.build {
# Call a separate method, and then insert those commands into the
# current list
process_method(int, :test_ev)
}
end
def test_ev
# Creates a list of event commands as a stand-alone EventBuilder and
# returns it
eb = EventBuilder.new {
show_text
add_message("test")
}
eb
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment