Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Fixed a self.world.ship is None bug.

  • Loading branch information...
commit 70f7b17855f9213952f6db49300e3c3cf2292fea 1 parent 4348aba
Al Sweigart authored August 09, 2012

Showing 1 changed file with 2 additions and 2 deletions. Show diff stats Hide diff stats

  1. 4  square-shooter/square-shooter_makeover.py
4  square-shooter/square-shooter_makeover.py
@@ -354,7 +354,7 @@ def update(self, delta_t):
354 354
 
355 355
     def handle_collisions(self, delta_t):
356 356
         for b in self.bubbles:
357  
-            if self.bullet != None and b.collides_with(self.bullet):
  357
+            if self.bullet != None and self.bullet.collides_with(b):
358 358
                 self.bubbles.remove(b)
359 359
                 if self.ship != None and not self.ship.has_super_bullets():
360 360
                     self.bullet = None
@@ -553,7 +553,7 @@ def render_bullet(self):
553 553
             RED,
554 554
             scale_and_round(pos.x, pos.y),
555 555
             int(round(bullet.radius * MAP_SIZE)))
556  
-        if self.world.ship.has_super_bullets():
  556
+        if self.world.ship != None and self.world.ship.has_super_bullets():
557 557
             pygame.draw.rect(self.screen, RED, bbox, 1)
558 558
 
559 559
     def render_powerup(self, powerup):

0 notes on commit 70f7b17

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