Fixed bug where player crashes game by using something while fade in progress.
This commit is contained in:
parent
d50d043a01
commit
9860036860
|
@ -28,11 +28,19 @@ class Level2(level.Level):
|
||||||
self.draw_background()
|
self.draw_background()
|
||||||
|
|
||||||
bonus = level_bonus.Level(self.game, self.graphics_dir)
|
bonus = level_bonus.Level(self.game, self.graphics_dir)
|
||||||
|
|
||||||
|
def f():
|
||||||
|
self._update = self.update
|
||||||
|
self.update = lambda *args: None
|
||||||
|
def g():
|
||||||
|
self.update = self._update
|
||||||
|
bonus.enter(self)
|
||||||
|
fadeout.Fadeout(self.game, g)
|
||||||
|
|
||||||
self.objects.append(
|
self.objects.append(
|
||||||
lever.Lever(
|
lever.Lever(
|
||||||
self, 64 * 2, 48 * 3,
|
self, 64 * 2, 48 * 3,
|
||||||
[lambda setting:
|
[lambda setting: f()],
|
||||||
fadeout.Fadeout(self.game, lambda: bonus.enter(self))],
|
|
||||||
toggling=False,
|
toggling=False,
|
||||||
anim='lever_updown'))
|
anim='lever_updown'))
|
||||||
|
|
||||||
|
|
|
@ -59,10 +59,18 @@ class Level(level.Level):
|
||||||
self.objects.append(block.Block(self, 64 * x, 48 * y,
|
self.objects.append(block.Block(self, 64 * x, 48 * y,
|
||||||
self.imgs['block1'], movable=True))
|
self.imgs['block1'], movable=True))
|
||||||
|
|
||||||
|
def f():
|
||||||
|
self._update = self.update
|
||||||
|
self.update = lambda *args: None
|
||||||
|
def g():
|
||||||
|
self.update = self._update
|
||||||
|
self.exit()
|
||||||
|
fadeout.Fadeout(self.game, g)
|
||||||
|
|
||||||
self.objects.append(
|
self.objects.append(
|
||||||
lever.Lever(
|
lever.Lever(
|
||||||
self, 64, 48,
|
self, 64, 48,
|
||||||
[lambda setting: fadeout.Fadeout(self.game, self.exit)],
|
[lambda setting: f()],
|
||||||
toggling=False,
|
toggling=False,
|
||||||
anim='lever_updown'))
|
anim='lever_updown'))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue