Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Simplified the Bubble2D is_out() method.

  • Loading branch information...
commit ffde511d11d1b1ec1d244c02175d88bcfebb2de7 1 parent e5a7df0
Al Sweigart authored August 07, 2012
2  square-shooter/square-shooter_makeover.py
@@ -100,7 +100,7 @@ def wrap_around(self):
100 100
 
101 101
     def is_out(self):
102 102
         """Returns True if the center of the bubble is outside the game map, False if it is on the map."""
103  
-        return self.pos.x < 0 or self.pos.y < 0 or self.pos.x > 1 or self.pos.y > 1
  103
+        return not (0 < self.pos.x < 1 and 0 < self.pos.y < 1)
104 104
 
105 105
     def collides_with(self, bubble):
106 106
         """Returns True if this bubble is intersecting with the Bubble2D object passed in for the bubble parameter."""

0 notes on commit ffde511

Please sign in to comment.
Something went wrong with that request. Please try again.