|
|
|
@ -36,15 +36,19 @@ class Manager(BaseObject):
|
|
|
|
|
# Summon the tiles
|
|
|
|
|
self.tiles = Tiles(288,0,game)
|
|
|
|
|
game.gameloop.summon(self.tiles)
|
|
|
|
|
# Spawn the first batch
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles))
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles))
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles))
|
|
|
|
|
|
|
|
|
|
# Demo
|
|
|
|
|
self.demo = None
|
|
|
|
|
self.demotimer = game.lib.Timer(4)
|
|
|
|
|
|
|
|
|
|
# Unlocks
|
|
|
|
|
self.skins = game.lib.getunlocks(self.game.globals["highscore"])
|
|
|
|
|
|
|
|
|
|
# Spawn the first batch
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles,skins=self.skins))
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles,skins=self.skins))
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles,skins=self.skins))
|
|
|
|
|
|
|
|
|
|
def step(self):
|
|
|
|
|
nblemmings = len(self.game.gameloop.findname("Lemming")) + len(self.game.gameloop.findname("Spawner"))
|
|
|
|
|
# Updating score
|
|
|
|
@ -53,7 +57,7 @@ class Manager(BaseObject):
|
|
|
|
|
# Spawning more lemmings
|
|
|
|
|
if (self.lives>0 and nblemmings>0):
|
|
|
|
|
if self.spawntimer.tick(self.game.dt):
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles,speedmargin=int(self.speedmargin+0.5)))
|
|
|
|
|
self.game.gameloop.summon(Spawner(self.game,self.tiles,speedmargin=int(self.speedmargin+0.5),skins=self.skins))
|
|
|
|
|
self.speedmargin+=self.speedstep
|
|
|
|
|
self.spawntimer = self.game.lib.Timer(self.basetime+nblemmings*self.steptime)
|
|
|
|
|
else:
|
|
|
|
|