Custom sprite for the lemming's fall
This commit is contained in:
parent
b5f893b51e
commit
fda400a78b
BIN
gamedata/assets/lemmings/falling.png
Normal file
BIN
gamedata/assets/lemmings/falling.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 844 B |
@ -9,7 +9,7 @@ class Spawner(BaseObject):
|
||||
super().__init__(spawnpoint[0],spawnpoint[1],game)
|
||||
self.sprite = game.sprite_lib["lemmings/shadow.png"]
|
||||
self.speedmargin = speedmargin
|
||||
self.fallsprite = game.sprite_lib["lemmings/Right/0.png"]
|
||||
self.fallsprite = game.sprite_lib["lemmings/falling.png"]
|
||||
self.distance = game.DISPLAY_HEIGHT
|
||||
self.timer = game.lib.Timer(3) # Seconds of telegraph before spawning the lemming
|
||||
|
||||
@ -23,10 +23,11 @@ class Spawner(BaseObject):
|
||||
self.game.globals["scameray"]+=3
|
||||
|
||||
def draw(self):
|
||||
# Display the lemming falling
|
||||
currentdistance = self.distance*self.timer.getratio()**2
|
||||
self.game.lib.drawcenter(self.game,self.fallsprite,self.rect[0]-self.game.globals["camerax"],self.rect[1]-currentdistance-self.game.globals["cameray"])
|
||||
|
||||
# Draw the shadow
|
||||
self.game.lib.drawcenter(self.game,self.sprite,self.rect[0]-self.game.globals["camerax"],self.rect[1]-self.game.globals["cameray"])
|
||||
|
||||
# Display the lemming falling
|
||||
currentdistance = self.distance*self.timer.getratio()**0.9
|
||||
self.game.lib.drawcenter(self.game,self.fallsprite,self.rect[0]-self.game.globals["camerax"],self.rect[1]-currentdistance-self.game.globals["cameray"])
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user