Added some tests with static variables
This commit is contained in:
18
test.py
18
test.py
@@ -22,12 +22,21 @@ objects = list()
|
|||||||
c = 0
|
c = 0
|
||||||
y = 10
|
y = 10
|
||||||
for x in range(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
|
y += 35
|
||||||
|
|
||||||
|
|
||||||
|
for object in GameObject.GameObject.objects:
|
||||||
|
object:GameObject
|
||||||
|
if(object.name == "Penner-9"):
|
||||||
|
print("Vorletzter!")
|
||||||
|
object.setpos(400,400)
|
||||||
|
print(object)
|
||||||
|
|
||||||
|
#rint(F"{len(GameObject.GameObject.objects)}")
|
||||||
print(F"{len(GameObject.GameObject.objects)}")
|
|
||||||
|
|
||||||
|
|
||||||
gamestate = True
|
gamestate = True
|
||||||
@@ -63,7 +72,6 @@ while(gamestate):
|
|||||||
for object in objects:
|
for object in objects:
|
||||||
object:GameObject.GameObject
|
object:GameObject.GameObject
|
||||||
|
|
||||||
|
|
||||||
if(pygame.mouse.get_pressed()[0]):
|
if(pygame.mouse.get_pressed()[0]):
|
||||||
object.setpos(mouse_pos[0], mouse_pos[1])
|
object.setpos(mouse_pos[0], mouse_pos[1])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user