From 874252e94e79250d818d8dd9683d85024ec7e1c7 Mon Sep 17 00:00:00 2001 From: Christian Date: Thu, 8 Aug 2024 16:44:51 +0200 Subject: [PATCH] Added some tests with static variables --- test.py | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/test.py b/test.py index 5cb1a61..38d3bb0 100644 --- a/test.py +++ b/test.py @@ -22,12 +22,21 @@ objects = list() c = 0 y = 10 for x in range(10): - objects.append(Enemy.Enemy("Penner", 500, y, 35, 35, image_enemy)) + obj = Enemy.Enemy(F"Penner-{x}", 500, y, 35, 35, image_enemy) + objects.append(obj) + obj = GameObject.GameObject("Test", y,0,0,0, testimage) + objects.append(obj) y += 35 - + + +for object in GameObject.GameObject.objects: + object:GameObject + if(object.name == "Penner-9"): + print("Vorletzter!") + object.setpos(400,400) + print(object) - -print(F"{len(GameObject.GameObject.objects)}") +#rint(F"{len(GameObject.GameObject.objects)}") gamestate = True @@ -63,7 +72,6 @@ while(gamestate): for object in objects: object:GameObject.GameObject - if(pygame.mouse.get_pressed()[0]): object.setpos(mouse_pos[0], mouse_pos[1])