Advertisement
marlosgama

Untitled

Jul 20th, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 0.40 KB | None | 0 0
  1.   def in_screen?(object_x, object_y = nil)
  2.     unless object_y
  3.       object = object_x
  4.       object_x = object.x
  5.       object_y = object.y
  6.     end
  7.     return false if object_x <= @display_x - 4
  8.     return false if object_x >= @display_x + Graphics.width / 32 + 3
  9.     return false if object_y <= @display_y - 4
  10.     return false if object_y >= @display_y + Graphics.height / 32 + 3
  11.     return true
  12.   end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement