TheoAllen

Iseng2 RGSSS3

Apr 2nd, 2013
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.96 KB | None | 0 0
  1. #==============================================================================
  2. # ** Main
  3. #------------------------------------------------------------------------------
  4. #  This processing is executed after module and class definition is finished.
  5. #==============================================================================
  6.  
  7. # rgss_main { SceneManager.run }
  8.  
  9. def updates
  10.   Graphics.update
  11.   Input.update
  12.   if Input.press?(:RIGHT)
  13.     $test.x += 5 unless $test.x + $test.width == Graphics.width
  14.     print_pos
  15.   elsif Input.press?(:LEFT)
  16.     $test.x -= 5 unless $test.x == 0
  17.     print_pos
  18.   elsif Input.press?(:DOWN)
  19.     $test.y += 5 unless $test.y + $test.height ==  Graphics.height
  20.     print_pos
  21.   elsif Input.press?(:UP)
  22.     $test.y -= 5 unless $test.y == 0
  23.     print_pos
  24.   end
  25. end
  26.  
  27. def print_pos
  28.   p $test.x.to_s + " " + $test.y.to_s
  29. end
  30.  
  31. DataManager.init
  32. $test = Window_Base.new(0,0,100,100)
  33. Audio.bgm_play("Audio/BGM/Battle1")
  34. updates while true
Advertisement
Add Comment
Please, Sign In to add comment