Browse Source

Spawn enemies based on level

master
Elis Axelsson 4 years ago
parent
commit
e2850a7a43
  1. 8
      main.py

8
main.py

@ -5,10 +5,11 @@ import pygame
from classes.towers.bubbler import Bubbler
from classes.enemies.ogre import Ogre
from classes.settings import Settings
from classes.levels import Levels
from classes.map import Map
settings = Settings()
levels = Levels()
map = Map()
# Init pygame and set up screen.
@ -36,6 +37,11 @@ while True:
if pressedKeys[pygame.K_SPACE]:
enemies.append(Ogre(settings.enemyStart))
# Spawn enemies according to the level
newEnemy = levels.get_enemy()
if newEnemy:
enemies.append(newEnemy)
# Draw map to screen
screen = map.draw(screen)

Loading…
Cancel
Save