瀏覽代碼

Spawn enemies based on level

master
Elis Axelsson 3 年前
父節點
當前提交
e2850a7a43
共有 1 個檔案被更改,包括 7 行新增1 行删除
  1. +7
    -1
      main.py

+ 7
- 1
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)


載入中…
取消
儲存