Skip to content

Commit 029c363

Browse files
author
Martin Milanesio
committed
Fix Pylint Issues
1 parent 9fd37a7 commit 029c363

File tree

1 file changed

+36
-23
lines changed

1 file changed

+36
-23
lines changed

ForzaSIMsceneryDATABASE.py

+36-23
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,21 @@
77

88
def blitRotate(surf, image, pos, originPos, angle):
99
# offset from pivot to center
10-
image_rect = image.get_rect(topleft=(pos[0] - originPos[0], pos[1] - originPos[1]))
10+
image_rect = image.get_rect(
11+
topleft=(
12+
pos[0] -
13+
originPos[0],
14+
pos[1] -
15+
originPos[1]))
1116
offset_center_to_pivot = pygame.math.Vector2(pos) - image_rect.center
1217

1318
# roatated offset from pivot to center
1419
rotated_offset = offset_center_to_pivot.rotate(-angle)
1520

1621
# roatetd image center
17-
rotated_image_center = (pos[0] - rotated_offset.x, pos[1] - rotated_offset.y)
22+
rotated_image_center = (
23+
pos[0] - rotated_offset.x,
24+
pos[1] - rotated_offset.y)
1825

1926
# get a rotated image
2027
rotated_image = pygame.transform.rotate(image, angle)
@@ -26,21 +33,25 @@ def blitRotate(surf, image, pos, originPos, angle):
2633

2734
def blitRotate2(surf, image, topleft, angle):
2835
rotated_image = pygame.transform.rotate(image, angle)
29-
new_rect = rotated_image.get_rect(center=image.get_rect(topleft=topleft).center)
36+
new_rect = rotated_image.get_rect(
37+
center=image.get_rect(
38+
topleft=topleft).center)
3039

3140
surf.blit(rotated_image, new_rect.topleft)
3241
pygame.draw.rect(surf, (255, 0, 0), new_rect, 2)
3342

43+
3444
def mainLoop(airplaneX, airplaneY):
3545
sw, sh = scrn.get_size()
3646
iw, ih = (sw * 1.9, sh * 1.9)
37-
plane = pygame.image.load('imagesDirectory/privateJETblue.png').convert_alpha()
47+
plane = pygame.image.load(
48+
'imagesDirectory/privateJETblue.png').convert_alpha()
3849
planeFlip = pygame.transform.flip(plane, True, False)
3950
img = pygame.image.load('imagesDirectory/SpringInYosemite.jpeg').convert()
40-
backgroundImage = pygame.transform.scale(img, (iw,ih))
51+
backgroundImage = pygame.transform.scale(img, (iw, ih))
4152
crashed = False
42-
width=700
43-
height=300
53+
width = 700
54+
height = 300
4455
rotationAngle = 0
4556
while not crashed:
4657
for event in pygame.event.get():
@@ -55,16 +66,17 @@ def mainLoop(airplaneX, airplaneY):
5566
if keys[pygame.K_RIGHT]:
5667
width = width * 0.999
5768
height = height * 0.999
58-
airplaneX=airplaneX + 1
69+
airplaneX = airplaneX + 1
5970
if keys[pygame.K_LEFT]:
6071
width = width * 1.001
6172
height = height * 1.001
62-
airplaneX=airplaneX-1
73+
airplaneX = airplaneX - 1
6374
if keys[pygame.K_c]:
6475
img = pygame.image.load('imagesDirectory/ct.jpeg').convert()
6576
backgroundImage = pygame.transform.scale(img, (iw, ih))
6677
if keys[pygame.K_g]:
67-
img = pygame.image.load('imagesDirectory/SpringInYosemite.jpeg').convert()
78+
img = pygame.image.load(
79+
'imagesDirectory/SpringInYosemite.jpeg').convert()
6880
backgroundImage = pygame.transform.scale(img, (iw, ih))
6981
if keys[pygame.K_y]:
7082
img = pygame.image.load('imagesDirectory/vf.jpeg').convert()
@@ -76,10 +88,12 @@ def mainLoop(airplaneX, airplaneY):
7688
plane = pygame.image.load('imagesDirectory/j2.png').convert_alpha()
7789
planeFlip = pygame.transform.flip(plane, True, False)
7890
if keys[pygame.K_2]:
79-
plane = pygame.image.load('imagesDirectory/privateJETblue.png').convert_alpha()
91+
plane = pygame.image.load(
92+
'imagesDirectory/privateJETblue.png').convert_alpha()
8093
planeFlip = pygame.transform.flip(plane, True, False)
8194
if keys[pygame.K_4]:
82-
plane = pygame.image.load('imagesDirectory/A380.png').convert_alpha()
95+
plane = pygame.image.load(
96+
'imagesDirectory/A380.png').convert_alpha()
8397
planeFlip = pygame.transform.flip(plane, True, False)
8498
if keys[pygame.K_a]:
8599
img = pygame.image.load('imagesDirectory/ap.jpeg').convert()
@@ -91,25 +105,24 @@ def mainLoop(airplaneX, airplaneY):
91105
img = pygame.image.load('imagesDirectory/a2.jpeg').convert()
92106
backgroundImage = pygame.transform.scale(img, (iw, ih))
93107
if keys[pygame.K_r]:
94-
rotationAngle=rotationAngle+1
108+
rotationAngle = rotationAngle + 1
95109
backgroundImage = pygame.transform.scale(img, (iw, ih))
96-
blitRotate(scrn, backgroundImage, (sw / 2, sh / 2), (iw / 2, ih / 2), rotationAngle)
110+
blitRotate(scrn, backgroundImage, (sw / 2, sh / 2),
111+
(iw / 2, ih / 2), rotationAngle)
97112
planeScaled = pygame.transform.scale(planeFlip, (width, height))
98-
scrn.blit(planeScaled, (airplaneX,airplaneY))
113+
scrn.blit(planeScaled, (airplaneX, airplaneY))
99114
pygame.display.flip()
100115

101-
pygame.init()
102-
x=1792
103-
y=1080
104-
105-
scrn=pygame.display.set_mode((x,y))
106116

107-
pygame.display.set_caption( 'panorama' )
117+
pygame.init()
118+
x = 1792
119+
y = 1080
108120

121+
scrn = pygame.display.set_mode((x, y))
109122

123+
pygame.display.set_caption('panorama')
110124

111125

112-
mainLoop(500,500)
126+
mainLoop(500, 500)
113127
pygame.quit()
114128
quit()
115-

0 commit comments

Comments
 (0)