Adding asteroids/fields and collision
This commit is contained in:
@@ -13,6 +13,11 @@ class CircleShape(pygame.sprite.Sprite):
|
||||
self.velocity = pygame.Vector2(0, 0)
|
||||
self.radius = radius
|
||||
|
||||
def collision(self, other):
|
||||
if self.position.distance_to(other.position) <= (self.radius + other.radius):
|
||||
return True
|
||||
return False
|
||||
|
||||
def draw(self, screen):
|
||||
# sub-classes must override
|
||||
pass
|
||||
|
||||
Reference in New Issue
Block a user