-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPlatform.py
More file actions
31 lines (28 loc) · 1.11 KB
/
Copy pathPlatform.py
File metadata and controls
31 lines (28 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from pygame.sprite import Sprite
from pygame.image import load
import os
class platform(Sprite):
def __init__(self, img):
super().__init__()
self.image = load(os.getcwd() + '/img/' + img + '.png')
self.rect = self.image.get_rect()
@staticmethod
def generatePlatforms():
imgs = ['platform1', 'layer2_l', 'layer2', 'pillar_l', 'pillar_r', 'shortStage', 'shortStage', 'shortStage', 'shortStage', 'topStage', 'topStage']
coordinates = [(0, 800), (270, 690), (780, 690), (270, 700), (1100, 700), (280, 500), (890, 500), (280, 350), (890, 350), (170, 200), (780, 200)]
platFormList = list()
for (eachImg, eachCoordinate) in zip(imgs, coordinates):
plat = platform(img = eachImg)
plat.rect.x, plat.rect.y = eachCoordinate
platFormList.append(plat)
return platFormList
@staticmethod
def generateSticks():
imgs = ['sticks', 'sticks', 'bottomSticks']
coordinates = [(0, 690), (1330, 690), (350, 720)]
stickList = list()
for (eachImg, eachCoordinate) in zip(imgs, coordinates):
stick = platform(img = eachImg)
stick.rect.x, stick.rect.y = eachCoordinate
stickList.append(stick)
return stickList