Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- health_x = 100
- #Lives
- IMAGE = pygame.image.load("ducklife.png")
- life = [IMAGE.get_rect(), IMAGE.get_rect(), IMAGE.get_rect()]
- life[0].x = 170
- life[0].y = 20
- life[1].x = 150
- life[1].y = 20
- life[2].x = 130
- life[2].y = 20
- #All level objects
- #Movement Restricters
- 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)]
- #Health Bar
- health = pygame.Rect(25, 20, health_x, 15)
- health_bar = pygame.Rect(20,15, 180, 25)
- #Level 1 objects
- #Floor
- floor1 = pygame.Rect(1, 550, 600, 100)
- #Platforms
- 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)]
- 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)]
- #Obstacles
- 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)]
- #Level 2 objects
- #Floor
- floor2 = pygame.Rect(1, 550, 600, 100)
- #platforms
- 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)]
- 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)]
- #Obstacles
- 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)]
- #Level 3 objects
- #floor
- floor3 = pygame.Rect(1,550,600,100)
- #platforms
- platforms3_a = [pygame.Rect(300, 51, 50, 2)]
- platforms3_b = [pygame.Rect(300, 44, 50, 7)]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement