Merge branch 'master' of hongabar.org:robotgame

This commit is contained in:
Niels Serup
2012-08-11 17:43:24 +02:00
35 changed files with 18 additions and 9 deletions

View File

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

View File

@@ -86,6 +86,7 @@ class Loader(object):
('arrow_left', os.path.join('matt', 'right')),
('stairs', 'stairs'),
('elevating_column', 'elevating_column'),
('mirror', 'mirror')]
):