forked from ayte/PinmikPanik
Added more pinmiks on game start
This commit is contained in:
parent
59a7b97b94
commit
09eef1ae4d
@ -8,24 +8,17 @@ class Demo(BaseObject):
|
|||||||
super().__init__(game.DISPLAY_WIDTH/2,game.DISPLAY_HEIGHT/2,game,0,0)
|
super().__init__(game.DISPLAY_WIDTH/2,game.DISPLAY_HEIGHT/2,game,0,0)
|
||||||
|
|
||||||
self.blinktimer = game.lib.Timer(0.5)
|
self.blinktimer = game.lib.Timer(0.5)
|
||||||
self.pinmik = game.gameloop.findname("Lemming")[0]
|
|
||||||
self.move()
|
|
||||||
|
|
||||||
self.maxblink = 6
|
self.maxblink = 6
|
||||||
|
|
||||||
self.depth = 6
|
self.depth = 6
|
||||||
|
|
||||||
def move(self):
|
|
||||||
self.rect[0] = self.pinmik.rect.center[0]
|
|
||||||
self.rect[1] = self.pinmik.rect.center[1]+50
|
|
||||||
|
|
||||||
def step(self):
|
def step(self):
|
||||||
|
|
||||||
self.blinktimer.tick(self.game.dt)
|
self.blinktimer.tick(self.game.dt)
|
||||||
|
|
||||||
if self.blinktimer.getloops()>=self.maxblink:
|
if self.blinktimer.getloops()>=self.maxblink:
|
||||||
self.game.gameloop.delid(self.id)
|
self.game.gameloop.delid(self.id)
|
||||||
self.move()
|
|
||||||
|
|
||||||
def draw(self):
|
def draw(self):
|
||||||
sprites = self.game.getSpriteDir("cursor/")
|
sprites = self.game.getSpriteDir("cursor/")
|
||||||
@ -37,4 +30,5 @@ class Demo(BaseObject):
|
|||||||
else:
|
else:
|
||||||
sprite.set_alpha(255)
|
sprite.set_alpha(255)
|
||||||
if self.blinktimer.getloops()<self.maxblink:
|
if self.blinktimer.getloops()<self.maxblink:
|
||||||
self.game.lib.drawcenter(self.game,sprite,self.rect[0],self.rect[1])
|
for pinmik in self.game.gameloop.findname("Lemming"):
|
||||||
|
self.game.lib.drawcenter(self.game,sprite,pinmik.rect.center[0],pinmik.rect.center[1]+50)
|
||||||
|
@ -36,7 +36,9 @@ class Manager(BaseObject):
|
|||||||
# Summon the tiles
|
# Summon the tiles
|
||||||
self.tiles = Tiles(288,0,game)
|
self.tiles = Tiles(288,0,game)
|
||||||
game.gameloop.summon(self.tiles)
|
game.gameloop.summon(self.tiles)
|
||||||
# Spawn the first one
|
# 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))
|
self.game.gameloop.summon(Spawner(self.game,self.tiles))
|
||||||
|
|
||||||
# Demo
|
# Demo
|
||||||
|
@ -11,7 +11,7 @@ class Spawner(BaseObject):
|
|||||||
self.speedmargin = speedmargin
|
self.speedmargin = speedmargin
|
||||||
self.fallsprite = game.sprite_lib["lemmings/falling.png"]
|
self.fallsprite = game.sprite_lib["lemmings/falling.png"]
|
||||||
self.distance = game.DISPLAY_HEIGHT
|
self.distance = game.DISPLAY_HEIGHT
|
||||||
self.timer = game.lib.Timer(3) # Seconds of telegraph before spawning the lemming
|
self.timer = game.lib.Timer(2.5+random.random()) # Seconds of telegraph before spawning the lemming
|
||||||
|
|
||||||
def step(self):
|
def step(self):
|
||||||
if self.timer.tick(self.game.dt):
|
if self.timer.tick(self.game.dt):
|
||||||
|
@ -13,7 +13,7 @@ class Tiles(BaseObject):
|
|||||||
self.nbcells = nbcells
|
self.nbcells = nbcells
|
||||||
self.cellsize = cellsize
|
self.cellsize = cellsize
|
||||||
|
|
||||||
self.saferadius = 2
|
self.saferadius = 3
|
||||||
|
|
||||||
self.grid = self.gengrid(game.sprite_lib["collisionmap.png"])
|
self.grid = self.gengrid(game.sprite_lib["collisionmap.png"])
|
||||||
self.spawns = self.getspawnpoints(self.grid,saferadius=self.saferadius)
|
self.spawns = self.getspawnpoints(self.grid,saferadius=self.saferadius)
|
||||||
|
Loading…
Reference in New Issue
Block a user