Colors unlock with highscore
BIN
gamedata/assets/lemmings/blue/Left/0.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Left/1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Left/2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Left/3.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
gamedata/assets/lemmings/blue/Right/0.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Right/1.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Right/2.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gamedata/assets/lemmings/blue/Right/3.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
gamedata/assets/lemmings/blue/falling.png
Normal file
After Width: | Height: | Size: 11 KiB |
@ -129,3 +129,11 @@ def savesettings(dirname,bgm=1,sfx=1,filename="settings.ini"):
|
||||
|
||||
with open(filepath,'w') as configfile:
|
||||
config.write(configfile)
|
||||
|
||||
def getunlocks(highscore):
|
||||
unlocks = {"normal":["base"],"specials":[]}
|
||||
if highscore>=50:
|
||||
unlocks["normal"].append("green")
|
||||
if highscore>=250:
|
||||
unlocks["normal"].append("blue")
|
||||
return unlocks
|
||||
|
@ -16,6 +16,8 @@ class MenuBackground(BaseObject):
|
||||
|
||||
# Pinmik falling
|
||||
self.pinmiktimer = game.lib.Timer(1)
|
||||
unlocks = game.lib.getunlocks(game.globals["highscore"])
|
||||
self.skins = unlocks["normal"]+unlocks["specials"]
|
||||
|
||||
|
||||
def step(self):
|
||||
@ -27,7 +29,7 @@ class MenuBackground(BaseObject):
|
||||
|
||||
if self.pinmiktimer.tick(self.game.dt):
|
||||
self.pinmiktimer = game.lib.Timer(1+random.random())
|
||||
self.game.gameloop.summon(FallingPinmik(game))
|
||||
self.game.gameloop.summon(FallingPinmik(game,skins=self.skins))
|
||||
|
||||
def draw(self):
|
||||
game = self.game
|
||||
|
@ -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:
|
||||
|
@ -4,7 +4,7 @@ from gamedata.objects.ingame.lemmings import Lemming
|
||||
import random
|
||||
|
||||
class Spawner(BaseObject):
|
||||
def __init__(self,game,tiles,speedmargin=5,skins={"normal":["base","green"],"specials":[]}):
|
||||
def __init__(self,game,tiles,speedmargin=5,skins={"normal":["base"],"specials":[]}):
|
||||
spawnpoint = random.choice(tiles.spawns)
|
||||
super().__init__(spawnpoint[0],spawnpoint[1],game)
|
||||
self.sprite = game.sprite_lib["lemmings/shadow.png"].copy()
|
||||
|