Fixed invalid keyword argument error.

This commit is contained in:
Sakse Dalum 2012-08-10 12:56:13 +02:00
parent 4afd08724f
commit 4eab2f55ed
2 changed files with 7 additions and 7 deletions

View File

@ -197,8 +197,7 @@ class ActionBlock(Block):
def __init__(self, level, x, y, action=None, movable=True):
self.__dict__.update(locals())
Block.__init__(
self, level, x, y, img=level.imgs['block1'],
movable=movable)
self, level, x, y, 'block1', movable=movable)
self._last_pos = None
def update(self, e, t, dt):

View File

@ -203,7 +203,7 @@ class Level1(level.Level):
boxes += boxes
boxes += [logic.colourboxes.generate_random_box(1) for _ in range(3)]
random.shuffle(boxes)
pos_colour = {}
for box, (x, y) in zip(boxes, itertools.product(range(3), range(3))):
# self.tiles.append(tile.Tile(self, x * 64 + task3_pos[0],
@ -216,13 +216,15 @@ class Level1(level.Level):
for i in range(3)]
self.objects.extend(action_blocks)
wells = [block.ColorWell(self, task3_pos[0] + 64, task3_pos[1] + 48 * 5)]
wells = [block.ColorWell(self, task3_pos[0] + 64,
task3_pos[1] + 48 * 5)]
self.objects.extend(wells)
def update_wells(block):
cur_boxes = []
for block in action_blocks:
box = pos_colour.get(((block.x - task3_pos[0]) / 64, (block.y - task3_pos[1] - 48) / 48))
box = pos_colour.get(((block.x - task3_pos[0]) / 64,
(block.y - task3_pos[1] - 48) / 48))
if box:
cur_boxes.append(box)
@ -235,8 +237,7 @@ class Level1(level.Level):
for b in action_blocks:
b.action = update_wells
### Task 4: Inverted bits
task4_pos = (64 * 13, 48 * 13)