Some cleanup
This commit is contained in:
19
game.py
19
game.py
@@ -18,6 +18,7 @@ items = [
|
||||
GameObject.item_extra_life("Extra-Life", 0, 0, 30, 30, None)
|
||||
]
|
||||
|
||||
enemys_spawned = list()
|
||||
items_spawned = list()
|
||||
|
||||
#Override
|
||||
@@ -30,7 +31,7 @@ def loadlevels():
|
||||
|
||||
def item_handler(screen:pygame.Surface):
|
||||
|
||||
spawn_chance = random.randint(0, 10)
|
||||
spawn_chance = random.randint(0, 1000)
|
||||
print(spawn_chance)
|
||||
if(spawn_chance == 0):
|
||||
#print("Spawne item")
|
||||
@@ -39,13 +40,25 @@ def item_handler(screen:pygame.Surface):
|
||||
for item in items_spawned:
|
||||
item:GameObject.Item
|
||||
print(item)
|
||||
|
||||
if(item.pos_y >= screen.get_size()[1]):
|
||||
items_spawned.remove(item)
|
||||
item.move(0, item.speed)
|
||||
item.render(screen)
|
||||
|
||||
pass
|
||||
|
||||
def spawn_item_random(screen:pygame.Surface):
|
||||
|
||||
items_spawned.append(copy.deepcopy(items[0]))
|
||||
print("Spawn")
|
||||
pass
|
||||
|
||||
def spawn_enemys(type:object, count:int):
|
||||
for i in range(count):
|
||||
pass
|
||||
pass
|
||||
|
||||
def run(screen:pygame.Surface):
|
||||
screen = screen
|
||||
item_handler(screen)
|
||||
|
||||
pass
|
||||
Reference in New Issue
Block a user