add dinos
This commit is contained in:
19
main.py
19
main.py
@@ -14,10 +14,29 @@ sword = Actor("sword")
|
||||
dinosuars = []
|
||||
corpses = []
|
||||
|
||||
spawn_interval = 2.0
|
||||
min_spawn_interval = 0.2
|
||||
spawn_timer = 0
|
||||
game_time = 0
|
||||
|
||||
def draw():
|
||||
screen.fill((100,220,100))
|
||||
apple.draw()
|
||||
|
||||
def spawn_dinosaur():
|
||||
dino = Actor("dino")
|
||||
|
||||
side = random.randint(0,3)
|
||||
if side == 0:
|
||||
dino_x = random.randint(0.WIDTH)
|
||||
dino_y = -50
|
||||
elif side == 1:
|
||||
dino_x = random.randint(0,WIDTH)
|
||||
dino_y = HEIGHT + 50
|
||||
elif side == 2:
|
||||
dino_x = WIDTH + 50
|
||||
dino_y = random.randint(0,HEIGHT)
|
||||
dinosuars.append(dino)
|
||||
|
||||
|
||||
pgzrun.go()
|
||||
Reference in New Issue
Block a user