Changed number of steps required in task 2.

This commit is contained in:
Sakse Dalum 2012-08-12 00:54:58 +02:00
parent dbd025d3d0
commit bee5e9f683
1 changed files with 34 additions and 22 deletions

View File

@ -135,32 +135,44 @@ class Level1(level.Level):
playfield, nsteps, directions = ( playfield, nsteps, directions = (
logic.rollingstone.generate_simple_unsolved_solvable_extra( logic.rollingstone.generate_simple_unsolved_solvable_extra(
task2_size[0], task2_size[1], 7, 30)) task2_size[0], task2_size[1], 5, 50))
for i, j in playfield:
self.objects.append(
block.Block(self,
task2_pos[0] + 64 * i,
task2_pos[1] + 48 * j,
self.imgs['block1'],
movable=True)
if (random.randint(0, 2) or (i, j) == (4, 0)) else
block.Block(self,
task2_pos[0] + 64 * i,
task2_pos[1] + 48 * j,
self.imgs['block3'],
movable=False))
arrow_blocks = []
n = 0 n = 0
for i in directions: c = len(playfield) / len(directions)
arrow_blocks.append( ns = [k * c for k in range(len(directions))]
block.ArrowBlock(self, arrow_blocks = []
task2_pos[0] + 64 * (task2_size[0] - n), for i, j in playfield:
task2_pos[1] + 48 * (task2_size[1] + 2), if n in ns:
i.next_pos((0, 0)))) arrow_blocks.append(
block.ArrowBlock(self,
task2_pos[0] + 64 * i,
task2_pos[1] + 48 * j,
directions[n / c].next_pos((0, 0))))
else:
self.objects.append(
block.Block(self,
task2_pos[0] + 64 * i,
task2_pos[1] + 48 * j,
self.imgs['block1'],
movable=True)
if (random.randint(0, 2) or (i, j) == (4, 0)) else
block.Block(self,
task2_pos[0] + 64 * i,
task2_pos[1] + 48 * j,
self.imgs['block3'],
movable=False))
n += 1 n += 1
# arrow_blocks = []
# n = 0
# for i in directions:
# arrow_blocks.append(
# block.ArrowBlock(self,
# task2_pos[0] + 64 * (task2_size[0] - n),
# task2_pos[1] + 48 * (task2_size[1] + 2),
# i.next_pos((0, 0))))
# n += 1
self.objects.extend(arrow_blocks) self.objects.extend(arrow_blocks)
self.objects.append(lever.Lever(self, self.objects.append(lever.Lever(self,
task2_pos[0] + 64 * 3, task2_pos[0] + 64 * 3,