Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- import character, setting
- class Level(object):
- def level_one(self):
- self.blocks_pos = [ ]
- self.start_pos = ()
- self.finish_pos = ()
- level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
- [0,0,0,0,0,0,1,0,3,0,1,0,0,0,0,0],#1
- [1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0],#2
- [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0],#3
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#5
- [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],#6
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#7
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#9
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0] #2
- ]
- for row in range(12):
- for col in range(16):
- if level[row][col] == 1:
- x = (30*col)
- y = (30*row)
- self.blocks_pos += [(x,y)]
- elif level[row][col] == 2:
- x_s = (30*col)
- y_s = (30*row)
- self.start_pos = (x_s-30,y_s-30)
- elif level[row][col] == 3:
- x_e = (30*col)
- y_e = (30*row)
- self.finish_pos = (x_e-30,y_e-10)
- return (self.blocks_pos,self.start_pos,self.finish_pos)
- def level_two(self):
- self.blocks_pos = [ ]
- self.start_pos = ()
- self.finish_pos = ()
- level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
- [0,0,0,0,0,0,1,0,3,0,1,0,0,0,0,0],#1
- [0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0],#2
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
- [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#5
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],#7
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#9
- [0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],#0
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] #2
- ]
- for row in range(12):
- for col in range(16):
- if level[row][col] == 1:
- x = (30*col)
- y = (30*row)
- self.blocks_pos += [(x,y)]
- elif level[row][col] == 2:
- x_s = (30*col)
- y_s = (30*row)
- self.start_pos = (x_s-30,y_s-30)
- elif level[row][col] == 3:
- x_e = (30*col)
- y_e = (30*row)
- self.finish_pos = (x_e-30,y_e-10)
- return (self.blocks_pos, self.start_pos, self.finish_pos)
- def level_three(self):
- self.blocks_pos = [ ]
- self.start_pos = ()
- self.finish_pos = ()
- level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
- [0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#2
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
- [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#5
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
- [3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#7
- [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],#8
- [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#9
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0] #2
- ]
- for row in range(12):
- for col in range(16):
- if level[row][col] == 1:
- x = (30*col)
- y = (30*row)
- self.blocks_pos += [(x,y)]
- elif level[row][col] == 2:
- x_s = (30*col)
- y_s = (30*row)
- self.start_pos = (x_s-30,y_s-30)
- elif level[row][col] == 3:
- x_e = (30*col)
- y_e = (30*row)
- self.finish_pos = (x_e-30,y_e-10)
- return (self.blocks_pos, self.start_pos, self.finish_pos)
- def level_four(self):
- self.blocks_pos = [ ]
- self.start_pos = ()
- self.finish_pos = ()
- level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
- [0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#2
- [0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],#3
- [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],#5
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
- [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,3],#7
- [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],#8
- [0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1],#9
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0] #2
- ]
- for row in range(12):
- for col in range(16):
- if level[row][col] == 1:
- x = (30*col)
- y = (30*row)
- self.blocks_pos += [(x,y)]
- elif level[row][col] == 2:
- x_s = (30*col)
- y_s = (30*row)
- self.start_pos = (x_s-30,y_s-30)
- elif level[row][col] == 3:
- x_e = (30*col)
- y_e = (30*row)
- self.finish_pos = (x_e-30,y_e-10)
- return (self.blocks_pos,self.start_pos,self.finish_pos)
- def level_five(self):
- self.blocks_pos = [ ]
- self.start_pos = ()
- self.finish_pos = ()
- level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
- [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0],#2
- [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
- [1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0],#4
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],#5
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
- [0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,3],#7
- [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
- [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1],#9
- [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],#0
- [0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0],#1
- [0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0] #2
- ]
- for row in range(12):
- for col in range(16):
- if level[row][col] == 1:
- x = (30*col)
- y = (30*row)
- self.blocks_pos += [(x,y)]
- elif level[row][col] == 2:
- x_s = (30*col)
- y_s = (30*row)
- self.start_pos = (x_s-30,y_s-30)
- elif level[row][col] == 3:
- x_e = (30*col)
- y_e = (30*row)
- self.finish_pos = (x_e-30,y_e-10)
- return (self.blocks_pos,self.start_pos,self.finish_pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement