Advertisement
bluesplay106

Ice Adventure - level.py

Dec 6th, 2011
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.50 KB | None | 0 0
  1. import pygame
  2. import character, setting
  3.  
  4. class Level(object):
  5. def level_one(self):
  6. self.blocks_pos = [ ]
  7. self.start_pos = ()
  8. self.finish_pos = ()
  9.  
  10. level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  11. [0,0,0,0,0,0,1,0,3,0,1,0,0,0,0,0],#1
  12. [1,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0],#2
  13. [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0],#3
  14. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
  15. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#5
  16. [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],#6
  17. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#7
  18. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
  19. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#9
  20. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
  21. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
  22. [0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,0] #2
  23. ]
  24.  
  25. for row in range(12):
  26. for col in range(16):
  27. if level[row][col] == 1:
  28. x = (30*col)
  29. y = (30*row)
  30. self.blocks_pos += [(x,y)]
  31. elif level[row][col] == 2:
  32. x_s = (30*col)
  33. y_s = (30*row)
  34. self.start_pos = (x_s-30,y_s-30)
  35. elif level[row][col] == 3:
  36. x_e = (30*col)
  37. y_e = (30*row)
  38. self.finish_pos = (x_e-30,y_e-10)
  39.  
  40. return (self.blocks_pos,self.start_pos,self.finish_pos)
  41.  
  42. def level_two(self):
  43. self.blocks_pos = [ ]
  44. self.start_pos = ()
  45. self.finish_pos = ()
  46.  
  47. level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  48. [0,0,0,0,0,0,1,0,3,0,1,0,0,0,0,0],#1
  49. [0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0],#2
  50. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
  51. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
  52. [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#5
  53. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
  54. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2],#7
  55. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
  56. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#9
  57. [0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0],#0
  58. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
  59. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0] #2
  60. ]
  61.  
  62. for row in range(12):
  63. for col in range(16):
  64. if level[row][col] == 1:
  65. x = (30*col)
  66. y = (30*row)
  67. self.blocks_pos += [(x,y)]
  68. elif level[row][col] == 2:
  69. x_s = (30*col)
  70. y_s = (30*row)
  71. self.start_pos = (x_s-30,y_s-30)
  72. elif level[row][col] == 3:
  73. x_e = (30*col)
  74. y_e = (30*row)
  75. self.finish_pos = (x_e-30,y_e-10)
  76.  
  77. return (self.blocks_pos, self.start_pos, self.finish_pos)
  78. def level_three(self):
  79. self.blocks_pos = [ ]
  80. self.start_pos = ()
  81. self.finish_pos = ()
  82. level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  83. [0,0,0,0,1,0,0,0,2,0,0,0,0,0,0,0],#1
  84. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#2
  85. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
  86. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
  87. [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#5
  88. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
  89. [3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],#7
  90. [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],#8
  91. [1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#9
  92. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
  93. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
  94. [0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0] #2
  95. ]
  96.  
  97. for row in range(12):
  98. for col in range(16):
  99. if level[row][col] == 1:
  100. x = (30*col)
  101. y = (30*row)
  102. self.blocks_pos += [(x,y)]
  103. elif level[row][col] == 2:
  104. x_s = (30*col)
  105. y_s = (30*row)
  106. self.start_pos = (x_s-30,y_s-30)
  107. elif level[row][col] == 3:
  108. x_e = (30*col)
  109. y_e = (30*row)
  110. self.finish_pos = (x_e-30,y_e-10)
  111.  
  112. return (self.blocks_pos, self.start_pos, self.finish_pos)
  113. def level_four(self):
  114. self.blocks_pos = [ ]
  115. self.start_pos = ()
  116. self.finish_pos = ()
  117.  
  118. level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  119. [0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0],#1
  120. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#2
  121. [0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0],#3
  122. [1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#4
  123. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],#5
  124. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
  125. [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,3],#7
  126. [0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0],#8
  127. [0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1],#9
  128. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#0
  129. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
  130. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,0] #2
  131. ]
  132.  
  133. for row in range(12):
  134. for col in range(16):
  135. if level[row][col] == 1:
  136. x = (30*col)
  137. y = (30*row)
  138. self.blocks_pos += [(x,y)]
  139. elif level[row][col] == 2:
  140. x_s = (30*col)
  141. y_s = (30*row)
  142. self.start_pos = (x_s-30,y_s-30)
  143. elif level[row][col] == 3:
  144. x_e = (30*col)
  145. y_e = (30*row)
  146. self.finish_pos = (x_e-30,y_e-10)
  147.  
  148. return (self.blocks_pos,self.start_pos,self.finish_pos)
  149. def level_five(self):
  150. self.blocks_pos = [ ]
  151. self.start_pos = ()
  152. self.finish_pos = ()
  153. level = [ # 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6
  154. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#1
  155. [0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0],#2
  156. [0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#3
  157. [1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0],#4
  158. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1],#5
  159. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#6
  160. [0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,3],#7
  161. [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],#8
  162. [0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1],#9
  163. [0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0],#0
  164. [0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0],#1
  165. [0,0,1,0,0,0,0,0,0,0,0,0,0,0,2,0] #2
  166. ]
  167.  
  168. for row in range(12):
  169. for col in range(16):
  170. if level[row][col] == 1:
  171. x = (30*col)
  172. y = (30*row)
  173. self.blocks_pos += [(x,y)]
  174. elif level[row][col] == 2:
  175. x_s = (30*col)
  176. y_s = (30*row)
  177. self.start_pos = (x_s-30,y_s-30)
  178. elif level[row][col] == 3:
  179. x_e = (30*col)
  180. y_e = (30*row)
  181. self.finish_pos = (x_e-30,y_e-10)
  182.  
  183. return (self.blocks_pos,self.start_pos,self.finish_pos)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement