Cleaned up some of the level-start code.

This commit is contained in:
Sakse Dalum
2012-08-08 23:00:39 +02:00
parent 43b3cd791c
commit 003f79d272
4 changed files with 23 additions and 22 deletions

View File

@@ -56,7 +56,7 @@ class ActionBlock(block.Block):
if (self.x, self.y) != self._last_pos and not self.is_moving:
self.action(self)
self._last_pos = self.x, self.y
worldobject.WorldObject.update(self, e, t, dt)
class ColorWell(block.Block):
@@ -70,7 +70,6 @@ class ColorWell(block.Block):
def set_colour(self, r, g, b):
self.well_colour = r * 255, g * 255, b * 255
self.img.fill(self.well_colour)
class Level3(level.Level):
def __init__(self, game, graphics_dir, paused=False):
@@ -97,7 +96,7 @@ class Level3(level.Level):
blocks = [ActionBlock(self, 64 * i, 0, action=None, movable=True)
for i in range(1, 4)]
self.objects.extend(blocks)
wells = [ColorWell(self, 64 * 5, 0)]
self.objects.extend(wells)
@@ -114,10 +113,10 @@ class Level3(level.Level):
well_colours = logic.colourboxes.get_colours(cur_boxes)
for i in range(len(wells)):
wells[i].set_colour(*well_colours[i])
for b in blocks:
b.action = update_wells
self.draw_background()