forked from ayte/PinmikPanik
Added some variations in pinmiks angles
This commit is contained in:
parent
09eef1ae4d
commit
12ba5d9107
@ -15,6 +15,8 @@ class Lemming(BaseObject):
|
|||||||
|
|
||||||
self.selected = False # If beeing redirected
|
self.selected = False # If beeing redirected
|
||||||
|
|
||||||
|
self.anglemargin = 25
|
||||||
|
|
||||||
# Used for movement
|
# Used for movement
|
||||||
self.restx = 0
|
self.restx = 0
|
||||||
self.resty = 0
|
self.resty = 0
|
||||||
@ -101,8 +103,9 @@ class Lemming(BaseObject):
|
|||||||
|
|
||||||
def launch(self):
|
def launch(self):
|
||||||
# Launch itself in the mouse direction
|
# Launch itself in the mouse direction
|
||||||
xdir, ydir = self.game.inputs["mouse"]["rel"]
|
xdiff = self.game.inputs["mouse"]["pos"][0]-self.rect.center[0]
|
||||||
self.direction = math.degrees(math.atan2(ydir,xdir))
|
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.speed = self.basespeed*4
|
||||||
self.cachedrel = []
|
self.cachedrel = []
|
||||||
|
Loading…
Reference in New Issue
Block a user