Guest User

Untitled

a guest
Jun 24th, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1.  
  2. class Setup
  3. def initialize
  4. @screen = Screen.new([800,600],0,[Rubygame::HWSURFACE, Rubygame::DOUBLEBUF])
  5. @queue = Rubygame::EventQueue.new()
  6. @queue.enable_new_style_events()
  7. end
  8.  
  9. def quit
  10. Rubygame.quit()
  11. exit
  12. end
  13.  
  14. def hook_quit
  15. quit_hooks = {
  16. :escape => :quit,
  17. Rubygame::Events::QuitRequested => :quit,
  18. }
  19. make_magic_hooks(quit_hooks)
  20. end
  21.  
  22. def run
  23. hook_quit()
  24. loop do
  25. @queue.each do |event|
  26. handle(event)
  27. end
  28. end
  29. end
  30. end
Add Comment
Please, Sign In to add comment