Advertisement
Guest User

Untitled

a guest
Jan 21st, 2018
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.18 KB | None | 0 0
  1. import pygame
  2. health_x = 100
  3.  
  4. #Lives
  5. IMAGE = pygame.image.load("ducklife.png")
  6. life = [IMAGE.get_rect(), IMAGE.get_rect(), IMAGE.get_rect()]
  7. life[0].x = 170
  8. life[0].y = 20
  9. life[1].x = 150
  10. life[1].y = 20
  11. life[2].x = 130
  12. life[2].y = 20
  13.  
  14. #All level objects
  15. #Movement Restricters
  16. restrictions = [pygame.Rect(-600,0, 600, 700), pygame.Rect(600, 0, 600,700), pygame.Rect(0, 225, 600, 4), pygame.Rect(0,595,600,4)]
  17. #Health Bar
  18. health = pygame.Rect(25, 20, health_x, 15)
  19. health_bar = pygame.Rect(20,15, 180, 25)
  20.  
  21. #Level 1 objects
  22. #Floor
  23. floor1 = pygame.Rect(1, 550, 600, 100)
  24. #Platforms
  25. platforms1_a = [pygame.Rect(0, 480, 400, 2),pygame.Rect(450, 480, 400, 2),pygame.Rect(0, 400, 250, 2),pygame.Rect(300,400 , 400, 2), pygame.Rect(250, 320, 100, 2),pygame.Rect(250,240,100,2),pygame.Rect(0, 160, 100, 2),pygame.Rect(150, 160, 500, 2)]
  26. platforms1_b = [pygame.Rect(0, 473, 400, 7),pygame.Rect(450, 473, 400, 7),pygame.Rect(0, 393, 250, 7),pygame.Rect(300,393 , 400, 7), pygame.Rect(250, 313, 100, 7),pygame.Rect(250,233,100,7),pygame.Rect(0, 153, 100, 7),pygame.Rect(150, 153, 500, 7)]
  27. #Obstacles
  28. obstacles1 = [pygame.Rect(1, 370, 10,10), pygame.Rect(600,450,10,10),pygame.Rect(1, 290, 10,10), pygame.Rect(450, 0, 10,10), pygame.Rect(350, 0, 10,10), pygame.Rect(250,0,10,10)]
  29.  
  30. #Level 2 objects
  31. #Floor
  32. floor2 = pygame.Rect(1, 550, 600, 100)
  33. #platforms
  34. platforms2_a = [pygame.Rect(400,484,200,2), pygame.Rect(0,410,40,2), pygame.Rect(520,336,40,2),pygame.Rect(521,262,79,2), pygame.Rect(250, 188, 50, 2 ), pygame.Rect(355,205,110,2), pygame.Rect(0,188,100,2), pygame.Rect(120,0,108, 2)]
  35. platforms2_b = [pygame.Rect(400,477,200,7), pygame.Rect(0,403,40,7), pygame.Rect(520,329,40,7),pygame.Rect(521,255,79,7), pygame.Rect(250, 181, 50, 7 ), pygame.Rect(355,198,110,7), pygame.Rect(0,181,100,7), pygame.Rect(120,-7,108, 7)]
  36. #Obstacles
  37. obstacles2 = [pygame.Rect(100, 458, 10,10), pygame.Rect(450, 458, 10, 10), pygame.Rect(525, 100, 10,10),pygame.Rect(565, 0, 10,10), pygame.Rect(442, 0, 10,10),pygame.Rect(370, 100, 10,10)]
  38.  
  39. #Level 3 objects
  40. #floor
  41. floor3 = pygame.Rect(1,550,600,100)
  42. #platforms
  43. platforms3_a = [pygame.Rect(300, 51, 50, 2)]
  44. platforms3_b = [pygame.Rect(300, 44, 50, 7)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement