Adding asteroids/fields and collision
This commit is contained in:
11
asteroid.py
11
asteroid.py
@@ -0,0 +1,11 @@
|
||||
import pygame
|
||||
from circleshape import CircleShape
|
||||
class Asteroid(CircleShape):
|
||||
def __init__(self, x, y, radius):
|
||||
super().__init__(x, y, radius)
|
||||
|
||||
def draw(self, screen):
|
||||
pygame.draw.circle(screen, "white", self.position, self.radius, 2)
|
||||
|
||||
def update(self, dt):
|
||||
self.position += (self.velocity * dt)
|
||||
Reference in New Issue
Block a user