Advertisement
diddlside

Untitled

Jul 30th, 2011
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.84 KB | None | 0 0
  1. class Test < Window_Command
  2.  
  3.   attr_accessor :close
  4.  
  5.   def initialize
  6.     s1 = "Kaufen"
  7.     s2 = "Zurück"
  8.    
  9.     super(192,[s1, s2])
  10.     self.opacity = 155
  11.     self.x = 120 - self.width / 2
  12.     self.y = 188
  13.    
  14.     Graphics.transition
  15.     # Main loop
  16.     loop do
  17.       # Update game screen
  18.       Graphics.update
  19.       # Update input information
  20.       Input.update
  21.       # Frame update
  22.       self.updateWindow
  23.       if @close == true
  24.         self.contents.clear
  25.         self.dispose
  26.         break
  27.       end
  28.     end
  29.   end
  30.  
  31.   def updateWindow
  32.     self.update
  33.     # If C button was pressed
  34.     if Input.trigger?(Input::C)
  35.       # Branch by command window cursor position
  36.       case self.index
  37.       when 0  # New game
  38.         print 1
  39.       when 1  # Continue
  40.         @close = true
  41.       end
  42.     end
  43.   end
  44. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement