added player drawing onto the screen
This commit is contained in:
parent
bfd9971cfb
commit
ef4695aae2
4 changed files with 57 additions and 2 deletions
22
circleshape.py
Normal file
22
circleshape.py
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
import pygame
|
||||
|
||||
# Base class for game objects
|
||||
class CircleShape(pygame.sprite.Sprite):
|
||||
def __init__(self, x, y, radius):
|
||||
# we will be using this later
|
||||
if hasattr(self, "containers"):
|
||||
super().__init__(self.containers)
|
||||
else:
|
||||
super().__init__()
|
||||
|
||||
self.position = pygame.Vector2(x, y)
|
||||
self.velocity = pygame.Vector2(0, 0)
|
||||
self.radius = radius
|
||||
|
||||
def draw(self, screen):
|
||||
# sub-classes must override
|
||||
pass
|
||||
|
||||
def update(self, dt):
|
||||
# sub-classes must override
|
||||
pass
|
||||
Loading…
Add table
Add a link
Reference in a new issue