Added some slight speed variations

This commit is contained in:
theo@manjaro 2021-09-11 15:21:31 +02:00
parent 936d77bbe7
commit 56488ec3da

View File

@ -2,13 +2,13 @@ from gamedata.objects.base import BaseObject
import random,math
class Lemming(BaseObject):
def __init__(self,x,y,game):
def __init__(self,x,y,game,speedmargin=5):
super().__init__(x,y,game)
self.direction = random.randint(0,360)
self.radius = 30 # Radius in which the mouse can click
self.basespeed = 60 # Speed that he normally walks by
self.basespeed = 50+random.randint(-speedmargin,speedmargin) # Speed that he normally walks by
self.normalspeed = self.basespeed # Speed "objective"
self.speed = self.normalspeed # Current speed, leaning towards objective speed
self.speed = 0 # Current speed, leaning towards objective speed
self.selected = False # If beeing redirected