From 3268737075e6435e1ce24b980e09833233dab284 Mon Sep 17 00:00:00 2001 From: "theo@manjaro" Date: Wed, 15 Sep 2021 21:14:53 +0200 Subject: [PATCH] Fixed screen shake --- gamedata/objects/ingame/lemmings.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/gamedata/objects/ingame/lemmings.py b/gamedata/objects/ingame/lemmings.py index 6210841..7732648 100644 --- a/gamedata/objects/ingame/lemmings.py +++ b/gamedata/objects/ingame/lemmings.py @@ -7,7 +7,6 @@ class Lemming(BaseObject): self.direction = random.randint(0,360) self.holdrect = self.rect.copy() self.holdradius = 80 - print(speedmargin) self.holdrect = self.holdrect.inflate(self.holdradius,self.holdradius) self.basespeed = max(20,40+random.randint(-speedmargin,speedmargin)) # Speed that he normally walks by self.holdtimer = game.lib.Timer(2.5) # Max seconds of holding @@ -93,8 +92,12 @@ class Lemming(BaseObject): dead = False if dead: self.manager.death() - self.game.globals["scamerax"]+=5 - self.game.globals["scameray"]+=5 + if self.game.globals["scamerax"]*self.game.globals["scameray"]>5: # Avoiding shaking to much + self.game.globals["scamerax"]+=1 + self.game.globals["scamerax"]+=1 + else: + self.game.globals["scamerax"]=5 + self.game.globals["scameray"]=5 self.game.gameloop.delid(self.id) # Spawn particles