grifdail

Untitled

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