Added colorattribute to GameObjects class

This commit is contained in:
2024-01-20 09:36:15 +01:00
parent e595d085c6
commit 55c060559d
3 changed files with 20 additions and 12 deletions

View File

@@ -12,6 +12,7 @@ pygame.display.set_caption("Testgame")
WEISS = ( 255, 255, 255)
SCHWARZ = (0,0,0)
GRUEN = (0, 255, 0)
active = True
@@ -73,10 +74,15 @@ def spawn_entities(x:int, list_of_objects:list):
list_of_objects.append(Entity)
count += 1
player = Player("Player", MAINSCREEN, MAINSCREEN_SIZE, 10, 10, 10, is_player=False, is_rect=True, rect_size=(80,80))
player = Player("Player", MAINSCREEN, MAINSCREEN_SIZE, 10, 10, 10, is_player=False, is_rect=True, color=(0,255,0) ,rect_size=(80,80))
goo = GOIMAGE("TESTOBJEKT", MAINSCREEN, MAINSCREEN_SIZE, 0,0,0,image="data/models/testmodel.bmp")
testlist = list()
for y in range(10):
Entity = GOIMAGE("Testobject", MAINSCREEN, MAINSCREEN_SIZE, posx_init=rand.randint(10, 600), posy_init=rand.randint(10, 600), image="data/models/testmodel.bmp")
testlist.append(Entity)
background = pygame.surface.Surface((640,480))
x = 3600
@@ -138,6 +144,10 @@ while active == True:
append_follwer(xy[0], xy[1])
count_follower += 1
for t in testlist:
t:GOIMAGE
t.draw()
#Zeichnet alle Verfolgerobjekte, sofern sie vorliegend sind
#TODO: Follower sollen ab dem zweiten Objekt dem vorangegangenen Objekt folgen und nicht dem player