Browse Source

Spawn enemies based on level

master
Elis Axelsson 3 years ago
parent
commit
e2850a7a43
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      main.py

+ 7
- 1
main.py View File

@@ -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