Permalink
Browse files

Simplified the Bubble2D is_out() method.

  • Loading branch information...
1 parent e5a7df0 commit ffde511d11d1b1ec1d244c02175d88bcfebb2de7 @asweigart committed Aug 8, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 square-shooter/square-shooter_makeover.py
@@ -100,7 +100,7 @@ def wrap_around(self):
def is_out(self):
"""Returns True if the center of the bubble is outside the game map, False if it is on the map."""
- return self.pos.x < 0 or self.pos.y < 0 or self.pos.x > 1 or self.pos.y > 1
+ return not (0 < self.pos.x < 1 and 0 < self.pos.y < 1)
def collides_with(self, bubble):
"""Returns True if this bubble is intersecting with the Bubble2D object passed in for the bubble parameter."""

0 comments on commit ffde511

Please sign in to comment.