diff --git a/gamedata/objects/ingame/lemmings.py b/gamedata/objects/ingame/lemmings.py index 61761c9..fbb98a6 100644 --- a/gamedata/objects/ingame/lemmings.py +++ b/gamedata/objects/ingame/lemmings.py @@ -15,6 +15,8 @@ class Lemming(BaseObject): self.selected = False # If beeing redirected + self.anglemargin = 25 + # Used for movement self.restx = 0 self.resty = 0 @@ -101,8 +103,9 @@ class Lemming(BaseObject): def launch(self): # Launch itself in the mouse direction - xdir, ydir = self.game.inputs["mouse"]["rel"] - self.direction = math.degrees(math.atan2(ydir,xdir)) + xdiff = self.game.inputs["mouse"]["pos"][0]-self.rect.center[0] + ydiff = self.game.inputs["mouse"]["pos"][1]-self.rect.center[1] + self.direction = math.degrees(math.atan2(ydiff,xdiff))+random.randint(-self.anglemargin,self.anglemargin) self.speed = self.basespeed*4 self.cachedrel = []