Added player collision detect

This commit is contained in:
Christian
2024-08-13 15:43:22 +02:00
parent 5b8f38bab2
commit 644c418b2d
2 changed files with 31 additions and 17 deletions

View File

@@ -4,10 +4,10 @@ class GameObject(object):
objects = list()
def __init__(self, name, pos_x, pos_y, width, height, image=None) -> None:
self.name = name
self.pos_x = pos_x
self.pos_y = pos_y
self.width = width
self.height = height
self.pos_x:int = pos_x
self.pos_y:int = pos_y
self.width:int = width
self.height:int = height
self.image = image
self.rect:pygame.Rect
self.objects.append(self)
@@ -149,6 +149,10 @@ class Enemy(GameObject):
if(y != 0):
self.pos_y += y
def movementqueue_run(self):
pass
class Projectile(GameObject):
shots = list()
_id_count = 0