52 lines
1.1 KiB
Python
52 lines
1.1 KiB
Python
############################################################
|
|
## Implement all Gamemechanics here! ##
|
|
############################################################
|
|
|
|
import GameObject
|
|
import animations
|
|
from levels import *
|
|
import pygame
|
|
import logger
|
|
import random
|
|
import copy
|
|
|
|
#Leveldefinitions
|
|
levels_list.append(first_level("First Level", (500,500), 10, 2))
|
|
|
|
|
|
items = [
|
|
GameObject.item_extra_life("Extra-Life", 0, 0, 30, 30, None)
|
|
]
|
|
|
|
items_spawned = list()
|
|
|
|
#Override
|
|
def loadlevels():
|
|
for level in levels_list:
|
|
if(type(level) == "level"):
|
|
print("LEVEL")
|
|
print(level)
|
|
pass
|
|
|
|
def item_handler(screen:pygame.Surface):
|
|
|
|
spawn_chance = random.randint(0, 10)
|
|
print(spawn_chance)
|
|
if(spawn_chance == 0):
|
|
#print("Spawne item")
|
|
spawn_item_random(screen)
|
|
|
|
for item in items_spawned:
|
|
item:GameObject.Item
|
|
print(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
|