grifdail

Untitled

May 31st, 2012
42
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 1.54 KB | None | 0 0
  1. require "rubygems"
  2. require "gosu"
  3. #-------------General
  4. require "./KeyConfig.rb"
  5. require "./SRC/General/Mode.rb"
  6. require "./SRC/General/Button.rb"
  7. require "./SRC/General/Box.rb"
  8. require "./SRC/General/Animation.rb"
  9. #-------------Communication
  10. require "./SRC/Communication/Word.rb"
  11. require "./SRC/Communication/Sentence.rb"
  12. require "./SRC/Communication/UpCom.rb"
  13. require "./SRC/Communication/Civilisation.rb"
  14. #-------------Exploration
  15. require "./SRC/Exploration/ModeSpace.rb"
  16. require "./SRC/Exploration/SpaceItem.rb"
  17. require "./SRC/Exploration/SpaceShip.rb"
  18. require "./SRC/Exploration/Shoot.rb"
  19. require "./SRC/Exploration/Scrolling.rb"
  20. require "./SRC/Exploration/IA.rb"
  21. require "./SRC/Exploration/Hud.rb"
  22. require "./SRC/Exploration/SSU.rb"
  23.  
  24.  
  25. class GameWindows < Gosu::Window
  26.     attr_accessor :pointer_activated
  27.    
  28.     def initialize()
  29.         super(640,480,false,20)
  30.         @pointer = Gosu::Image.new(self,"Image/mouse.png",true)
  31.         @pointer_activated = false
  32.     end
  33.    
  34.     def update
  35.         $mode.update
  36.     end
  37.    
  38.     def draw
  39.         $mode.draw
  40.         @pointer.draw($window.mouse_x,$window.mouse_y,128) if @pointer_activated
  41.     end
  42.    
  43.     def switch_mode(new_mode)
  44.         $mode.delete unless @mode == nil
  45.         $mode = new_mode
  46.         $mode.start
  47.     end
  48.    
  49.     def button_down(id)
  50.     #puts id
  51.     #key pad
  52.     #1=>65436
  53.     #2=>65433
  54.     #3=>65435
  55.     #4=>65430
  56.     #5=>65437
  57.     #6=>65432
  58.     #7=>65439
  59.     #8=>65431
  60.     #9=>65434
  61.     end
  62.    
  63. end
  64.  
  65. #puts "salut ", "entre dans l'ordre Z,Q,S,D,8,6,4","Les chifres sur le pave num s'il te plait"
  66. $window = GameWindows.new
  67. $window.switch_mode(ModeSpace.new)
  68. $window.show
Advertisement
Add Comment
Please, Sign In to add comment