IceDragon200

[RND]AutosavePrototype

Apr 8th, 2012
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.28 KB | None | 0 0
  1. def save!()
  2.   puts "Saving"
  3.   # // do_save
  4.   puts "Saved"
  5. end
  6. def float2min(n)
  7.   Integer(n / 60)
  8. end
  9. @saved = false
  10. @last_time = Time.now
  11. loop do
  12.   Graphics.update
  13.   Input.update
  14.   if(float2min(Time.now-last_time)>30)
  15.     save!()
  16.     @last_time = Time.now
  17.   end
  18. end
Advertisement
Add Comment
Please, Sign In to add comment