Changed number of settings to 5.

This commit is contained in:
Sakse Dalum 2012-08-11 15:00:50 +02:00
parent c248375bbb
commit 90a3ec6a16
1 changed files with 3 additions and 2 deletions

View File

@ -418,7 +418,7 @@ class Wheel(block.Block):
self.frame = 0 self.frame = 0
self.anim_speed = 15 self.anim_speed = 15
self.nsettings = 4 self.nsettings = 5
self.setting = random.randint(0, self.nsettings - 1) self.setting = random.randint(0, self.nsettings - 1)
if self.immitate: if self.immitate:
self.on = self.setting == self.immitate.setting self.on = self.setting == self.immitate.setting
@ -447,7 +447,8 @@ class Wheel(block.Block):
def update(self, e, t, dt): def update(self, e, t, dt):
# Update the animation # Update the animation
l = len(self.level.imgs[self.anim]) l = len(self.level.imgs[self.anim])
if not (int(self.frame) == self.setting * (l - 1) / (self.nsettings - 1)): if not (int(self.frame) == self.setting * (l - 1)
/ (self.nsettings - 1)):
self.frame = ((self.frame + self.anim_speed * dt) % l self.frame = ((self.frame + self.anim_speed * dt) % l
if (self.setting > 0 and self.anim_direction > 0) if (self.setting > 0 and self.anim_direction > 0)
or (self.setting == self.nsettings - 1 or (self.setting == self.nsettings - 1