Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Setup
- def initialize
- @screen = Screen.new([800,600],0,[Rubygame::HWSURFACE, Rubygame::DOUBLEBUF])
- @queue = Rubygame::EventQueue.new()
- @queue.enable_new_style_events()
- end
- def quit
- Rubygame.quit()
- exit
- end
- def hook_quit
- quit_hooks = {
- :escape => :quit,
- Rubygame::Events::QuitRequested => :quit,
- }
- make_magic_hooks(quit_hooks)
- end
- def run
- hook_quit()
- loop do
- @queue.each do |event|
- handle(event)
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment