From 6cd5e68193f8db21f6dd6864c3f0e4fb9b5ffe28 Mon Sep 17 00:00:00 2001 From: kajarosz Date: Wed, 23 Feb 2022 16:35:34 +0100 Subject: [PATCH 1/4] adjusted code to fulfill PEP-8 requirements --- .idea/.gitignore | 3 + .idea/Pygame-Tutorials.iml | 8 + .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 4 + .idea/modules.xml | 8 + .idea/vcs.xml | 6 + Game/Tutorial #10.py | 63 +++-- Game/Tutorial #3.py | 91 ------- Game/Tutorial #4.py | 97 ------- Game/Tutorial #5.py | 135 ---------- Game/Tutorial #6.py | 179 ------------- Game/Tutorial #7.py | 200 -------------- Game/Tutorial #8.py | 215 --------------- Game/Tutorial #9.py | 245 ------------------ 14 files changed, 65 insertions(+), 1195 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Pygame-Tutorials.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml delete mode 100644 Game/Tutorial #3.py delete mode 100644 Game/Tutorial #4.py delete mode 100644 Game/Tutorial #5.py delete mode 100644 Game/Tutorial #6.py delete mode 100644 Game/Tutorial #7.py delete mode 100644 Game/Tutorial #8.py delete mode 100644 Game/Tutorial #9.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Pygame-Tutorials.iml b/.idea/Pygame-Tutorials.iml new file mode 100644 index 0000000..bedc4ba --- /dev/null +++ b/.idea/Pygame-Tutorials.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..ae4b84f --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..221dd64 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Game/Tutorial #10.py b/Game/Tutorial #10.py index b37f667..6c8f825 100644 --- a/Game/Tutorial #10.py +++ b/Game/Tutorial #10.py @@ -1,7 +1,7 @@ import pygame pygame.init() -win = pygame.display.set_mode((500,480)) +win = pygame.display.set_mode((500, 480)) pygame.display.set_caption("First Game") @@ -12,16 +12,17 @@ clock = pygame.time.Clock() -bulletSound = pygame.mixer.Sound('bullet.wav') -hitSound = pygame.mixer.Sound('hit.wav') +bulletSound = pygame.mixer.Sound('bullet.mp3') +hitSound = pygame.mixer.Sound('hit.mp3') -music = pygame.mixer.music.load('music.mp3') +pygame.mixer.music.load('music.mp3') pygame.mixer.music.play(-1) score = 0 -class player(object): - def __init__(self,x,y,width,height): + +class Player(object): + def __init__(self, x, y, width, height): self.x = x self.y = y self.width = width @@ -39,20 +40,19 @@ def draw(self, win): if self.walkCount + 1 >= 27: self.walkCount = 0 - if not(self.standing): + if not self.standing: if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) + win.blit(walkLeft[self.walkCount // 3], (self.x, self.y)) self.walkCount += 1 elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 + win.blit(walkRight[self.walkCount // 3], (self.x, self.y)) + self.walkCount += 1 else: if self.right: win.blit(walkRight[0], (self.x, self.y)) else: win.blit(walkLeft[0], (self.x, self.y)) self.hitbox = (self.x + 17, self.y + 11, 29, 52) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) def hit(self): self.isJump = False @@ -61,8 +61,8 @@ def hit(self): self.y = 410 self.walkCount = 0 font1 = pygame.font.SysFont('comicsans', 100) - text = font1.render('-5', 1, (255,0,0)) - win.blit(text, (250 - (text.get_width()/2),200)) + text = font1.render('-5', 1, (255, 0, 0)) + win.blit(text, (250 - (text.get_width() / 2), 200)) pygame.display.update() i = 0 while i < 200: @@ -72,11 +72,10 @@ def hit(self): if event.type == pygame.QUIT: i = 201 pygame.quit() - -class projectile(object): - def __init__(self,x,y,radius,color,facing): +class Projectile(object): + def __init__(self, x, y, radius, color, facing): self.x = x self.y = y self.radius = radius @@ -84,11 +83,11 @@ def __init__(self,x,y,radius,color,facing): self.facing = facing self.vel = 8 * facing - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) + def draw(self, win): + pygame.draw.circle(win, self.color, (self.x, self.y), self.radius) -class enemy(object): +class Enemy(object): walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] @@ -105,23 +104,22 @@ def __init__(self, x, y, width, height, end): self.health = 10 self.visible = True - def draw(self,win): + def draw(self, win): self.move() if self.visible: if self.walkCount + 1 >= 33: self.walkCount = 0 if self.vel > 0: - win.blit(self.walkRight[self.walkCount //3], (self.x, self.y)) + win.blit(self.walkRight[self.walkCount // 3], (self.x, self.y)) self.walkCount += 1 else: - win.blit(self.walkLeft[self.walkCount //3], (self.x, self.y)) + win.blit(self.walkLeft[self.walkCount // 3], (self.x, self.y)) self.walkCount += 1 pygame.draw.rect(win, (255,0,0), (self.hitbox[0], self.hitbox[1] - 20, 50, 10)) pygame.draw.rect(win, (0,128,0), (self.hitbox[0], self.hitbox[1] - 20, 50 - (5 * (10 - self.health)), 10)) self.hitbox = (self.x + 17, self.y + 2, 31, 57) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) def move(self): if self.vel > 0: @@ -144,9 +142,8 @@ def hit(self): self.visible = False print('hit') - -def redrawGameWindow(): +def redraw_game_window(): win.blit(bg, (0,0)) text = font.render('Score: ' + str(score), 1, (0,0,0)) win.blit(text, (350, 10)) @@ -158,17 +155,17 @@ def redrawGameWindow(): pygame.display.update() -#mainloop +# mainloop font = pygame.font.SysFont('comicsans', 30, True) -man = player(200, 410, 64,64) -goblin = enemy(100, 410, 64, 64, 450) +man = Player(200, 410, 64,64) +goblin = Enemy(100, 410, 64, 64, 450) shootLoop = 0 bullets = [] run = True while run: clock.tick(27) - if goblin.visible == True: + if goblin.visible: if man.hitbox[1] < goblin.hitbox[1] + goblin.hitbox[3] and man.hitbox[1] + man.hitbox[3] > goblin.hitbox[1]: if man.hitbox[0] + man.hitbox[2] > goblin.hitbox[0] and man.hitbox[0] < goblin.hitbox[0] + goblin.hitbox[2]: man.hit() @@ -191,7 +188,7 @@ def redrawGameWindow(): score += 1 bullets.pop(bullets.index(bullet)) - if bullet.x < 500 and bullet.x > 0: + if 0 < bullet.x < 500: bullet.x += bullet.vel else: bullets.pop(bullets.index(bullet)) @@ -206,7 +203,7 @@ def redrawGameWindow(): facing = 1 if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) + bullets.append(Projectile(round(man.x + man.width // 2), round(man.y + man.height//2), 6, (0, 0, 0), facing)) shootLoop = 1 @@ -224,7 +221,7 @@ def redrawGameWindow(): man.standing = True man.walkCount = 0 - if not(man.isJump): + if not man.isJump: if keys[pygame.K_UP]: man.isJump = True man.right = False @@ -241,7 +238,7 @@ def redrawGameWindow(): man.isJump = False man.jumpCount = 10 - redrawGameWindow() + redraw_game_window() pygame.quit() diff --git a/Game/Tutorial #3.py b/Game/Tutorial #3.py deleted file mode 100644 index f230894..0000000 --- a/Game/Tutorial #3.py +++ /dev/null @@ -1,91 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - -x = 50 -y = 400 -width = 64 -height = 64 -vel = 5 -isJump = False -jumpCount = 10 -left = False -right = False -walkCount = 0 - - -def redrawGameWindow(): - global walkCount - win.blit(bg, (0,0)) - - if walkCount + 1 >= 27: - walkCount = 0 - - if left: - win.blit(walkLeft[walkCount//3], (x,y)) - walkCount += 1 - elif right: - win.blit(walkRight[walkCount//3], (x,y)) - walkCount +=1 - else: - win.blit(char, (x,y)) - - pygame.display.update() - - -#mainloop -run = True -while run: - clock.tick(27) - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - keys = pygame.key.get_pressed() - - if keys[pygame.K_LEFT] and x > vel: - x -= vel - left = True - right = False - elif keys[pygame.K_RIGHT] and x < 500 - width - vel: - x += vel - right = True - left = False - else: - right = False - left = False - walkCount = 0 - - if not(isJump): - if keys[pygame.K_SPACE]: - isJump = True - right = False - left = False - walkCount = 0 - else: - if jumpCount >= -10: - neg = 1 - if jumpCount < 0: - neg = -1 - y -= (jumpCount ** 2) * 0.5 * neg - jumpCount -= 1 - else: - isJump = False - jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #4.py b/Game/Tutorial #4.py deleted file mode 100644 index 985b1b5..0000000 --- a/Game/Tutorial #4.py +++ /dev/null @@ -1,97 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - win.blit(char, (self.x,self.y)) - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - man.draw(win) - - pygame.display.update() - - -#mainloop -man = player(200, 410, 64,64) -run = True -while run: - clock.tick(27) - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - keys = pygame.key.get_pressed() - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - else: - man.right = False - man.left = False - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_SPACE]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #5.py b/Game/Tutorial #5.py deleted file mode 100644 index 7264483..0000000 --- a/Game/Tutorial #5.py +++ /dev/null @@ -1,135 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not(self.standing): - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - - - -class projectile(object): - def __init__(self,x,y,radius,color,facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - man.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -#mainloop -man = player(200, 410, 64,64) -bullets = [] -run = True -while run: - clock.tick(27) - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.x < 500 and bullet.x > 0: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE]: - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #6.py b/Game/Tutorial #6.py deleted file mode 100644 index cdfc565..0000000 --- a/Game/Tutorial #6.py +++ /dev/null @@ -1,179 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not(self.standing): - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - - - -class projectile(object): - def __init__(self,x,y,radius,color,facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) - - -class enemy(object): - walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] - walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] - - def __init__(self, x, y, width, height, end): - self.x = x - self.y = y - self.width = width - self.height = height - self.path = [x, end] - self.walkCount = 0 - self.vel = 3 - - def draw(self, win): - self.move() - if self.walkCount + 1 >= 33: - self.walkCount = 0 - - if self.vel > 0: - win.blit(self.walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - else: - win.blit(self.walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - - def move(self): - if self.vel > 0: - if self.x < self.path[1] + self.vel: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.x += self.vel - self.walkCount = 0 - else: - if self.x > self.path[0] - self.vel: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.x += self.vel - self.walkCount = 0 - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - man.draw(win) - goblin.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -#mainloop -man = player(200, 410, 64,64) -goblin = enemy(100, 410, 64, 64, 300) -bullets = [] -run = True -while run: - clock.tick(27) - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.x < 500 and bullet.x > 0: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE]: - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #7.py b/Game/Tutorial #7.py deleted file mode 100644 index a856db4..0000000 --- a/Game/Tutorial #7.py +++ /dev/null @@ -1,200 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not(self.standing): - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - - -class projectile(object): - def __init__(self,x,y,radius,color,facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) - - -class enemy(object): - walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] - walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] - - def __init__(self, x, y, width, height, end): - self.x = x - self.y = y - self.width = width - self.height = height - self.end = end - self.path = [self.x, self.end] - self.walkCount = 0 - self.vel = 3 - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - - def draw(self,win): - self.move() - if self.walkCount + 1 >= 33: - self.walkCount = 0 - - if self.vel > 0: - win.blit(self.walkRight[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - else: - win.blit(self.walkLeft[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - def move(self): - if self.vel > 0: - if self.x + self.vel < self.path[1]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - else: - if self.x - self.vel > self.path[0]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - - def hit(self): - print('hit') - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - man.draw(win) - goblin.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -#mainloop -man = player(200, 410, 64,64) -goblin = enemy(100, 410, 64, 64, 450) -shootLoop = 0 -bullets = [] -run = True -while run: - clock.tick(27) - - if shootLoop > 0: - shootLoop += 1 - if shootLoop > 3: - shootLoop = 0 - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.y - bullet.radius < goblin.hitbox[1] + goblin.hitbox[3] and bullet.y + bullet.radius > goblin.hitbox[1]: - if bullet.x + bullet.radius > goblin.hitbox[0] and bullet.x - bullet.radius < goblin.hitbox[0] + goblin.hitbox[2]: - goblin.hit() - bullets.pop(bullets.index(bullet)) - - if bullet.x < 500 and bullet.x > 0: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE] and shootLoop == 0: - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) - - shootLoop = 1 - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #8.py b/Game/Tutorial #8.py deleted file mode 100644 index 18799bd..0000000 --- a/Game/Tutorial #8.py +++ /dev/null @@ -1,215 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - -score = 0 - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not(self.standing): - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - - -class projectile(object): - def __init__(self,x,y,radius,color,facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) - - -class enemy(object): - walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] - walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] - - def __init__(self, x, y, width, height, end): - self.x = x - self.y = y - self.width = width - self.height = height - self.end = end - self.path = [self.x, self.end] - self.walkCount = 0 - self.vel = 3 - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - self.health = 10 - self.visible = True - - def draw(self,win): - self.move() - if self.visible: - if self.walkCount + 1 >= 33: - self.walkCount = 0 - - if self.vel > 0: - win.blit(self.walkRight[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - else: - win.blit(self.walkLeft[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - - pygame.draw.rect(win, (255,0,0), (self.hitbox[0], self.hitbox[1] - 20, 50, 10)) - pygame.draw.rect(win, (0,128,0), (self.hitbox[0], self.hitbox[1] - 20, 50 - (5 * (10 - self.health)), 10)) - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - def move(self): - if self.vel > 0: - if self.x + self.vel < self.path[1]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - else: - if self.x - self.vel > self.path[0]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - - def hit(self): - if self.health > 0: - self.health -= 1 - else: - self.visible = False - print('hit') - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - text = font.render('Score: ' + str(score), 1, (0,0,0)) - win.blit(text, (390, 10)) - man.draw(win) - goblin.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -#mainloop -font = pygame.font.SysFont('comicsans', 30, True) -man = player(200, 410, 64,64) -goblin = enemy(100, 410, 64, 64, 450) -shootLoop = 0 -bullets = [] -run = True -while run: - clock.tick(27) - - if shootLoop > 0: - shootLoop += 1 - if shootLoop > 3: - shootLoop = 0 - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.y - bullet.radius < goblin.hitbox[1] + goblin.hitbox[3] and bullet.y + bullet.radius > goblin.hitbox[1]: - if bullet.x + bullet.radius > goblin.hitbox[0] and bullet.x - bullet.radius < goblin.hitbox[0] + goblin.hitbox[2]: - goblin.hit() - score += 1 - bullets.pop(bullets.index(bullet)) - - if bullet.x < 500 and bullet.x > 0: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE] and shootLoop == 0: - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) - - shootLoop = 1 - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - diff --git a/Game/Tutorial #9.py b/Game/Tutorial #9.py deleted file mode 100644 index 9183730..0000000 --- a/Game/Tutorial #9.py +++ /dev/null @@ -1,245 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500,480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - -bulletSound = pygame.mixer.Sound('bullet.wav') -hitSound = pygame.mixer.Sound('hit.wav') - -music = pygame.mixer.music.load('music.mp3') -pygame.mixer.music.play(-1) - -score = 0 - -class player(object): - def __init__(self,x,y,width,height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not(self.standing): - if self.left: - win.blit(walkLeft[self.walkCount//3], (self.x,self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount//3], (self.x,self.y)) - self.walkCount +=1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - def hit(self): - self.x = 60 - self.y = 410 - self.walkCount = 0 - font1 = pygame.font.SysFont('comicsans', 100) - text = font1.render('-5', 1, (255,0,0)) - win.blit(text, (250 - (text.get_width()/2),200)) - pygame.display.update() - i = 0 - while i < 300: - pygame.time.delay(10) - i += 1 - for event in pygame.event.get(): - if event.type == pygame.QUIT: - i = 301 - pygame.quit() - - - -class projectile(object): - def __init__(self,x,y,radius,color,facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self,win): - pygame.draw.circle(win, self.color, (self.x,self.y), self.radius) - - -class enemy(object): - walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] - walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] - - def __init__(self, x, y, width, height, end): - self.x = x - self.y = y - self.width = width - self.height = height - self.end = end - self.path = [self.x, self.end] - self.walkCount = 0 - self.vel = 3 - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - self.health = 10 - self.visible = True - - def draw(self,win): - self.move() - if self.visible: - if self.walkCount + 1 >= 33: - self.walkCount = 0 - - if self.vel > 0: - win.blit(self.walkRight[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - else: - win.blit(self.walkLeft[self.walkCount //3], (self.x, self.y)) - self.walkCount += 1 - - pygame.draw.rect(win, (255,0,0), (self.hitbox[0], self.hitbox[1] - 20, 50, 10)) - pygame.draw.rect(win, (0,128,0), (self.hitbox[0], self.hitbox[1] - 20, 50 - (5 * (10 - self.health)), 10)) - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - #pygame.draw.rect(win, (255,0,0), self.hitbox,2) - - def move(self): - if self.vel > 0: - if self.x + self.vel < self.path[1]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - else: - if self.x - self.vel > self.path[0]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - - def hit(self): - if self.health > 0: - self.health -= 1 - else: - self.visible = False - print('hit') - - - -def redrawGameWindow(): - win.blit(bg, (0,0)) - text = font.render('Score: ' + str(score), 1, (0,0,0)) - win.blit(text, (390, 10)) - man.draw(win) - goblin.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -#mainloop -font = pygame.font.SysFont('comicsans', 30, True) -man = player(200, 410, 64,64) -goblin = enemy(100, 410, 64, 64, 450) -shootLoop = 0 -bullets = [] -run = True -while run: - clock.tick(27) - - if man.hitbox[1] < goblin.hitbox[1] + goblin.hitbox[3] and man.hitbox[1] + man.hitbox[3] > goblin.hitbox[1]: - if man.hitbox[0] + man.hitbox[2] > goblin.hitbox[0] and man.hitbox[0] < goblin.hitbox[0] + goblin.hitbox[2]: - man.hit() - score -= 5 - - if shootLoop > 0: - shootLoop += 1 - if shootLoop > 3: - shootLoop = 0 - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.y - bullet.radius < goblin.hitbox[1] + goblin.hitbox[3] and bullet.y + bullet.radius > goblin.hitbox[1]: - if bullet.x + bullet.radius > goblin.hitbox[0] and bullet.x - bullet.radius < goblin.hitbox[0] + goblin.hitbox[2]: - hitSound.play() - goblin.hit() - score += 1 - bullets.pop(bullets.index(bullet)) - - if bullet.x < 500 and bullet.x > 0: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE] and shootLoop == 0: - bulletSound.play() - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(projectile(round(man.x + man.width //2), round(man.y + man.height//2), 6, (0,0,0), facing)) - - shootLoop = 1 - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not(man.isJump): - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redrawGameWindow() - -pygame.quit() - - From a42cb1d71096da3d37d75a92199295996da59bcb Mon Sep 17 00:00:00 2001 From: kajarosz Date: Wed, 23 Feb 2022 17:17:17 +0100 Subject: [PATCH 2/4] created separate .py file for classes --- Game/Tutorial #10.py | 245 -------------------- Game/__pycache__/characters.cpython-310.pyc | Bin 0 -> 4629 bytes Game/characters.py | 130 +++++++++++ Game/run_game.py | 119 ++++++++++ 4 files changed, 249 insertions(+), 245 deletions(-) delete mode 100644 Game/Tutorial #10.py create mode 100644 Game/__pycache__/characters.cpython-310.pyc create mode 100644 Game/characters.py create mode 100644 Game/run_game.py diff --git a/Game/Tutorial #10.py b/Game/Tutorial #10.py deleted file mode 100644 index 6c8f825..0000000 --- a/Game/Tutorial #10.py +++ /dev/null @@ -1,245 +0,0 @@ -import pygame -pygame.init() - -win = pygame.display.set_mode((500, 480)) - -pygame.display.set_caption("First Game") - -walkRight = [pygame.image.load('R1.png'), pygame.image.load('R2.png'), pygame.image.load('R3.png'), pygame.image.load('R4.png'), pygame.image.load('R5.png'), pygame.image.load('R6.png'), pygame.image.load('R7.png'), pygame.image.load('R8.png'), pygame.image.load('R9.png')] -walkLeft = [pygame.image.load('L1.png'), pygame.image.load('L2.png'), pygame.image.load('L3.png'), pygame.image.load('L4.png'), pygame.image.load('L5.png'), pygame.image.load('L6.png'), pygame.image.load('L7.png'), pygame.image.load('L8.png'), pygame.image.load('L9.png')] -bg = pygame.image.load('bg.jpg') -char = pygame.image.load('standing.png') - -clock = pygame.time.Clock() - -bulletSound = pygame.mixer.Sound('bullet.mp3') -hitSound = pygame.mixer.Sound('hit.mp3') - -pygame.mixer.music.load('music.mp3') -pygame.mixer.music.play(-1) - -score = 0 - - -class Player(object): - def __init__(self, x, y, width, height): - self.x = x - self.y = y - self.width = width - self.height = height - self.vel = 5 - self.isJump = False - self.left = False - self.right = False - self.walkCount = 0 - self.jumpCount = 10 - self.standing = True - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - - def draw(self, win): - if self.walkCount + 1 >= 27: - self.walkCount = 0 - - if not self.standing: - if self.left: - win.blit(walkLeft[self.walkCount // 3], (self.x, self.y)) - self.walkCount += 1 - elif self.right: - win.blit(walkRight[self.walkCount // 3], (self.x, self.y)) - self.walkCount += 1 - else: - if self.right: - win.blit(walkRight[0], (self.x, self.y)) - else: - win.blit(walkLeft[0], (self.x, self.y)) - self.hitbox = (self.x + 17, self.y + 11, 29, 52) - - def hit(self): - self.isJump = False - self.jumpCount = 10 - self.x = 100 - self.y = 410 - self.walkCount = 0 - font1 = pygame.font.SysFont('comicsans', 100) - text = font1.render('-5', 1, (255, 0, 0)) - win.blit(text, (250 - (text.get_width() / 2), 200)) - pygame.display.update() - i = 0 - while i < 200: - pygame.time.delay(10) - i += 1 - for event in pygame.event.get(): - if event.type == pygame.QUIT: - i = 201 - pygame.quit() - - -class Projectile(object): - def __init__(self, x, y, radius, color, facing): - self.x = x - self.y = y - self.radius = radius - self.color = color - self.facing = facing - self.vel = 8 * facing - - def draw(self, win): - pygame.draw.circle(win, self.color, (self.x, self.y), self.radius) - - -class Enemy(object): - walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] - walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] - - def __init__(self, x, y, width, height, end): - self.x = x - self.y = y - self.width = width - self.height = height - self.end = end - self.path = [self.x, self.end] - self.walkCount = 0 - self.vel = 3 - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - self.health = 10 - self.visible = True - - def draw(self, win): - self.move() - if self.visible: - if self.walkCount + 1 >= 33: - self.walkCount = 0 - - if self.vel > 0: - win.blit(self.walkRight[self.walkCount // 3], (self.x, self.y)) - self.walkCount += 1 - else: - win.blit(self.walkLeft[self.walkCount // 3], (self.x, self.y)) - self.walkCount += 1 - - pygame.draw.rect(win, (255,0,0), (self.hitbox[0], self.hitbox[1] - 20, 50, 10)) - pygame.draw.rect(win, (0,128,0), (self.hitbox[0], self.hitbox[1] - 20, 50 - (5 * (10 - self.health)), 10)) - self.hitbox = (self.x + 17, self.y + 2, 31, 57) - - def move(self): - if self.vel > 0: - if self.x + self.vel < self.path[1]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - else: - if self.x - self.vel > self.path[0]: - self.x += self.vel - else: - self.vel = self.vel * -1 - self.walkCount = 0 - - def hit(self): - if self.health > 0: - self.health -= 1 - else: - self.visible = False - print('hit') - - -def redraw_game_window(): - win.blit(bg, (0,0)) - text = font.render('Score: ' + str(score), 1, (0,0,0)) - win.blit(text, (350, 10)) - man.draw(win) - goblin.draw(win) - for bullet in bullets: - bullet.draw(win) - - pygame.display.update() - - -# mainloop -font = pygame.font.SysFont('comicsans', 30, True) -man = Player(200, 410, 64,64) -goblin = Enemy(100, 410, 64, 64, 450) -shootLoop = 0 -bullets = [] -run = True -while run: - clock.tick(27) - - if goblin.visible: - if man.hitbox[1] < goblin.hitbox[1] + goblin.hitbox[3] and man.hitbox[1] + man.hitbox[3] > goblin.hitbox[1]: - if man.hitbox[0] + man.hitbox[2] > goblin.hitbox[0] and man.hitbox[0] < goblin.hitbox[0] + goblin.hitbox[2]: - man.hit() - score -= 5 - - if shootLoop > 0: - shootLoop += 1 - if shootLoop > 3: - shootLoop = 0 - - for event in pygame.event.get(): - if event.type == pygame.QUIT: - run = False - - for bullet in bullets: - if bullet.y - bullet.radius < goblin.hitbox[1] + goblin.hitbox[3] and bullet.y + bullet.radius > goblin.hitbox[1]: - if bullet.x + bullet.radius > goblin.hitbox[0] and bullet.x - bullet.radius < goblin.hitbox[0] + goblin.hitbox[2]: - hitSound.play() - goblin.hit() - score += 1 - bullets.pop(bullets.index(bullet)) - - if 0 < bullet.x < 500: - bullet.x += bullet.vel - else: - bullets.pop(bullets.index(bullet)) - - keys = pygame.key.get_pressed() - - if keys[pygame.K_SPACE] and shootLoop == 0: - bulletSound.play() - if man.left: - facing = -1 - else: - facing = 1 - - if len(bullets) < 5: - bullets.append(Projectile(round(man.x + man.width // 2), round(man.y + man.height//2), 6, (0, 0, 0), facing)) - - shootLoop = 1 - - if keys[pygame.K_LEFT] and man.x > man.vel: - man.x -= man.vel - man.left = True - man.right = False - man.standing = False - elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: - man.x += man.vel - man.right = True - man.left = False - man.standing = False - else: - man.standing = True - man.walkCount = 0 - - if not man.isJump: - if keys[pygame.K_UP]: - man.isJump = True - man.right = False - man.left = False - man.walkCount = 0 - else: - if man.jumpCount >= -10: - neg = 1 - if man.jumpCount < 0: - neg = -1 - man.y -= (man.jumpCount ** 2) * 0.5 * neg - man.jumpCount -= 1 - else: - man.isJump = False - man.jumpCount = 10 - - redraw_game_window() - -pygame.quit() - - diff --git a/Game/__pycache__/characters.cpython-310.pyc b/Game/__pycache__/characters.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..5cf620ff70c05140041c08ba8eb85dd516f0e237 GIT binary patch literal 4629 zcmcgvNpBm;6|U-y&E_J>mbKZV(G0Q-gNzV)w=;2^@s^o%7)R1v2n8I9)smW`NUFMJ zTLOg`@SO4!aw3oZ2l)w^Q|^5VkQ0I2a`PdR?^Q44$W~w=K$@smU+vxRy?XCsw^VW% zp1*C)ZO_ay_77@IJ_Z{1QG(AP1QWc?YU~LUn$W*tLihM9y{4gU2or5nwRN;DkwZJD z+J@j8tYVL_1FJSkPCf-R?xO_%gz#963s%!Sy=4qc!G}CST88ut85uG&WMwFqAv;6) zA>Yl{tYl9o>n~)en4waJ${Cu<&~%1oGIT-ho=bMWIOH{3%!*6juv%WsiFwqHSP+Y- z3t|Zxxg1$f+l^ySo>=Q^tG&)H>Z?h8Evc_3^^K&ynbfzE`gT&^iEB66$4&NelYQJ| zA2->@P4;n)bUS#cg{_b8F>Ce1&Wck6DM+d#gXnQ+hWJ)!Xf8J>C zKjdk|PcemPJLw4%T zE~#y6*AMrOw(C9FZF$Ww*m`=r+c@w(-8>4r(r>hbttV)1HTN2_(F{EqtoDv0yI%J@ zeps)Uuw}3SVexnUmift4>^H0Fil&Cy=|h+_rcCsA0Ht6K#cKPebd&*i(WkrJduB1gi8s5p{*M_wc`1rZtB zZ9j}`@&y;pF=6Ft8dgrSPW~bh9@%S6UZQUOx!+NykHx&&Nyx_YD?kB>GTBbE_zIr} zTH$4`y|lC|d`W}-3W@z_#rJGSZ%akl?k@o98o_e74qRDIQ&&e3EGbZo z1cd)**hg6=$~U_Qeluuvf)nl28*&k&ul3P)sML6DzBjax{CMv(VZ~DRmn+z^X3}wMnB=_(Bks#<=sfEbI)cb5 z`hy=qjBj%p{&0mm+~77ZqLd*CYcHqYoH&VhU}+U$4RN7^Xi=|6PQ8B66-RBt#d`hl zsL_r``Qd4d`RLEiLr{5c1VHh#VGJkTJq%L_;b#W$l0y_7|TPXx`9St*GeO=xr002 zvW5okBz+C9R&vU$%4m_*^kuW{#jkhfl|OvP+mfY!gA$NFKc#_|3~J~!ra z37XB=-lYu9f%g?^IWaF5;N-Sg6icY{;nXUAf}1J0m4e$TxDx|=eeGu%O80g%kRIZuhq&n>ZhDBD9^$5lxalEo zdWf4H;;zMezjcEtgs6+M4e;M@Fg%{PhOrydM52rdO{5W_C#29o#y5qfGCndKX5|HV zN8M33C0~s*hsypc=l>W7kLXs6?m(zCv{@;P!@`)rMLJSMWb_*0UQ7(gdsU_<0@-MT zNamjTfxq4M-i{X;4U}Kfs`0JK;>8B~1L~iQ7lfBk9DY((zHolfAhxMg>EJH)*?>{9 zg=)Bb1*wUY)Xl`y0DTCx`-WUa@+Ue+Bo2fjp>!5nxd}>#^@`GIo%v)wk-7JnALd)m zpwQ<;LR!Uyt`!Ae1dj*FP~>c=bC%7^pEJ)PGqy?#Y?jCgC>^ark0lDq^f^(4=}V%l zOkX5(E0a%E6>%7SM0$s6m{i990nmtO+UP3vkt0_0m{Gi>4mDFJl(~ugH8sD0sFWk) zp!>{|zoj0<5|uL$dx*2?IP6khoe0i`1j$!kBV8IfFCc%7!8p0X{6r8Pjp*TuR_32* zH!0cv>%@s&LNP;n-}E6&uddwTPXJI8*ddJlLm1`?SYeTS!Fs1zIDI7&lGpRajLp3Yp9b&MaP z1Vrr|KF4QyQA4f8b*d4vP4irhD7KJlq?G()(Qd1MEFD}5L<=6mwO@hTDi<;*-ubcO zL~s>lJ+gmf_N3nl= 27: + self.walkCount = 0 + + if not self.standing: + if self.left: + win.blit(self.walkLeft[self.walkCount // 3], (self.x, self.y)) + self.walkCount += 1 + elif self.right: + win.blit(self.walkRight[self.walkCount // 3], (self.x, self.y)) + self.walkCount += 1 + else: + if self.right: + win.blit(self.walkRight[0], (self.x, self.y)) + else: + win.blit(self.walkLeft[0], (self.x, self.y)) + self.hitbox = (self.x + 17, self.y + 11, 29, 52) + + def hit(self, win): + self.isJump = False + self.jumpCount = 10 + self.x = 100 + self.y = 410 + self.walkCount = 0 + font1 = pygame.font.SysFont('comicsans', 100) + text = font1.render('-5', 1, (255, 0, 0)) + win.blit(text, (250 - (text.get_width() / 2), 200)) + pygame.display.update() + i = 0 + while i < 200: + pygame.time.delay(10) + i += 1 + for event in pygame.event.get(): + if event.type == pygame.QUIT: + i = 201 + pygame.quit() + + +class Projectile(object): + def __init__(self, x, y, radius, color, facing): + self.x = x + self.y = y + self.radius = radius + self.color = color + self.facing = facing + self.vel = 8 * facing + + def draw(self, win): + pygame.draw.circle(win, self.color, (self.x, self.y), self.radius) + + +class Enemy(object): + walkRight = [pygame.image.load('R1E.png'), pygame.image.load('R2E.png'), pygame.image.load('R3E.png'), pygame.image.load('R4E.png'), pygame.image.load('R5E.png'), pygame.image.load('R6E.png'), pygame.image.load('R7E.png'), pygame.image.load('R8E.png'), pygame.image.load('R9E.png'), pygame.image.load('R10E.png'), pygame.image.load('R11E.png')] + walkLeft = [pygame.image.load('L1E.png'), pygame.image.load('L2E.png'), pygame.image.load('L3E.png'), pygame.image.load('L4E.png'), pygame.image.load('L5E.png'), pygame.image.load('L6E.png'), pygame.image.load('L7E.png'), pygame.image.load('L8E.png'), pygame.image.load('L9E.png'), pygame.image.load('L10E.png'), pygame.image.load('L11E.png')] + + def __init__(self, x, y, width, height, end): + self.x = x + self.y = y + self.width = width + self.height = height + self.end = end + self.path = [self.x, self.end] + self.walkCount = 0 + self.vel = 3 + self.hitbox = (self.x + 17, self.y + 2, 31, 57) + self.health = 10 + self.visible = True + + def draw(self, win): + self.move() + if self.visible: + if self.walkCount + 1 >= 33: + self.walkCount = 0 + + if self.vel > 0: + win.blit(self.walkRight[self.walkCount // 3], (self.x, self.y)) + self.walkCount += 1 + else: + win.blit(self.walkLeft[self.walkCount // 3], (self.x, self.y)) + self.walkCount += 1 + + pygame.draw.rect(win, (255,0,0), (self.hitbox[0], self.hitbox[1] - 20, 50, 10)) + pygame.draw.rect(win, (0,128,0), (self.hitbox[0], self.hitbox[1] - 20, 50 - (5 * (10 - self.health)), 10)) + self.hitbox = (self.x + 17, self.y + 2, 31, 57) + + def move(self): + if self.vel > 0: + if self.x + self.vel < self.path[1]: + self.x += self.vel + else: + self.vel = self.vel * -1 + self.walkCount = 0 + else: + if self.x - self.vel > self.path[0]: + self.x += self.vel + else: + self.vel = self.vel * -1 + self.walkCount = 0 + + def hit(self): + if self.health > 0: + self.health -= 1 + else: + self.visible = False diff --git a/Game/run_game.py b/Game/run_game.py new file mode 100644 index 0000000..2aa1235 --- /dev/null +++ b/Game/run_game.py @@ -0,0 +1,119 @@ +import pygame +from characters import Player, Projectile, Enemy +pygame.init() + +win = pygame.display.set_mode((500, 480)) +bg = pygame.image.load('bg.jpg') +pygame.display.set_caption("First Game") + +clock = pygame.time.Clock() + +bulletSound = pygame.mixer.Sound('bullet.mp3') +hitSound = pygame.mixer.Sound('hit.mp3') + +pygame.mixer.music.load('music.mp3') +pygame.mixer.music.play(-1) + +score = 0 + + +def redraw_game_window(): + win.blit(bg, (0, 0)) + text = font.render('Score: ' + str(score), 1, (0, 0, 0)) + win.blit(text, (350, 10)) + man.draw(win) + goblin.draw(win) + for bullet in bullets: + bullet.draw(win) + + pygame.display.update() + + +# mainloop +font = pygame.font.SysFont('comicsans', 30, True) +man = Player(200, 410, 64,64) +goblin = Enemy(100, 410, 64, 64, 450) +shootLoop = 0 +bullets = [] +run = True +while run: + clock.tick(27) + + if goblin.visible: + if man.hitbox[1] < goblin.hitbox[1] + goblin.hitbox[3] and man.hitbox[1] + man.hitbox[3] > goblin.hitbox[1]: + if man.hitbox[0] + man.hitbox[2] > goblin.hitbox[0] and man.hitbox[0] < goblin.hitbox[0] + goblin.hitbox[2]: + man.hit(win) + score -= 5 + + if shootLoop > 0: + shootLoop += 1 + if shootLoop > 3: + shootLoop = 0 + + for event in pygame.event.get(): + if event.type == pygame.QUIT: + run = False + + for bullet in bullets: + if bullet.y - bullet.radius < goblin.hitbox[1] + goblin.hitbox[3] and bullet.y + bullet.radius > goblin.hitbox[1]: + if bullet.x + bullet.radius > goblin.hitbox[0] and bullet.x - bullet.radius < goblin.hitbox[0] + goblin.hitbox[2]: + hitSound.play() + goblin.hit() + score += 1 + bullets.pop(bullets.index(bullet)) + + if 0 < bullet.x < 500: + bullet.x += bullet.vel + else: + bullets.pop(bullets.index(bullet)) + + keys = pygame.key.get_pressed() + + if keys[pygame.K_SPACE] and shootLoop == 0: + bulletSound.play() + if man.left: + facing = -1 + else: + facing = 1 + + if len(bullets) < 5: + bullets.append(Projectile(round(man.x + man.width // 2), round(man.y + man.height//2), 6, (0, 0, 0), facing)) + + shootLoop = 1 + + if keys[pygame.K_LEFT] and man.x > man.vel: + man.x -= man.vel + man.left = True + man.right = False + man.standing = False + elif keys[pygame.K_RIGHT] and man.x < 500 - man.width - man.vel: + man.x += man.vel + man.right = True + man.left = False + man.standing = False + else: + man.standing = True + man.walkCount = 0 + + if not man.isJump: + if keys[pygame.K_UP]: + man.isJump = True + man.right = False + man.left = False + man.walkCount = 0 + else: + if man.jumpCount >= -10: + neg = 1 + if man.jumpCount < 0: + neg = -1 + man.y -= (man.jumpCount ** 2) * 0.5 * neg + man.jumpCount -= 1 + else: + man.isJump = False + man.jumpCount = 10 + + redraw_game_window() + +pygame.quit() + + From ee11bc6c0ae8e534cdb2b9b96c4c00400324d838 Mon Sep 17 00:00:00 2001 From: kajarosz Date: Wed, 23 Feb 2022 17:21:11 +0100 Subject: [PATCH 3/4] removing pycharm files from git --- .idea/.gitignore | 3 --- .idea/Pygame-Tutorials.iml | 8 -------- .idea/inspectionProfiles/profiles_settings.xml | 6 ------ .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/vcs.xml | 6 ------ 6 files changed, 35 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/Pygame-Tutorials.iml delete mode 100644 .idea/inspectionProfiles/profiles_settings.xml delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/vcs.xml diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 26d3352..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml diff --git a/.idea/Pygame-Tutorials.iml b/.idea/Pygame-Tutorials.iml deleted file mode 100644 index bedc4ba..0000000 --- a/.idea/Pygame-Tutorials.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 105ce2d..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index ae4b84f..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 221dd64..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 94a25f7..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - \ No newline at end of file From 690bc6fe1489f63fcab5f8c830661a8d965b34f4 Mon Sep 17 00:00:00 2001 From: kajarosz Date: Wed, 23 Feb 2022 17:22:40 +0100 Subject: [PATCH 4/4] removing pycharm files from github --- Game/__pycache__/characters.cpython-310.pyc | Bin 4629 -> 0 bytes 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 Game/__pycache__/characters.cpython-310.pyc diff --git a/Game/__pycache__/characters.cpython-310.pyc b/Game/__pycache__/characters.cpython-310.pyc deleted file mode 100644 index 5cf620ff70c05140041c08ba8eb85dd516f0e237..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4629 zcmcgvNpBm;6|U-y&E_J>mbKZV(G0Q-gNzV)w=;2^@s^o%7)R1v2n8I9)smW`NUFMJ zTLOg`@SO4!aw3oZ2l)w^Q|^5VkQ0I2a`PdR?^Q44$W~w=K$@smU+vxRy?XCsw^VW% zp1*C)ZO_ay_77@IJ_Z{1QG(AP1QWc?YU~LUn$W*tLihM9y{4gU2or5nwRN;DkwZJD z+J@j8tYVL_1FJSkPCf-R?xO_%gz#963s%!Sy=4qc!G}CST88ut85uG&WMwFqAv;6) zA>Yl{tYl9o>n~)en4waJ${Cu<&~%1oGIT-ho=bMWIOH{3%!*6juv%WsiFwqHSP+Y- z3t|Zxxg1$f+l^ySo>=Q^tG&)H>Z?h8Evc_3^^K&ynbfzE`gT&^iEB66$4&NelYQJ| zA2->@P4;n)bUS#cg{_b8F>Ce1&Wck6DM+d#gXnQ+hWJ)!Xf8J>C zKjdk|PcemPJLw4%T zE~#y6*AMrOw(C9FZF$Ww*m`=r+c@w(-8>4r(r>hbttV)1HTN2_(F{EqtoDv0yI%J@ zeps)Uuw}3SVexnUmift4>^H0Fil&Cy=|h+_rcCsA0Ht6K#cKPebd&*i(WkrJduB1gi8s5p{*M_wc`1rZtB zZ9j}`@&y;pF=6Ft8dgrSPW~bh9@%S6UZQUOx!+NykHx&&Nyx_YD?kB>GTBbE_zIr} zTH$4`y|lC|d`W}-3W@z_#rJGSZ%akl?k@o98o_e74qRDIQ&&e3EGbZo z1cd)**hg6=$~U_Qeluuvf)nl28*&k&ul3P)sML6DzBjax{CMv(VZ~DRmn+z^X3}wMnB=_(Bks#<=sfEbI)cb5 z`hy=qjBj%p{&0mm+~77ZqLd*CYcHqYoH&VhU}+U$4RN7^Xi=|6PQ8B66-RBt#d`hl zsL_r``Qd4d`RLEiLr{5c1VHh#VGJkTJq%L_;b#W$l0y_7|TPXx`9St*GeO=xr002 zvW5okBz+C9R&vU$%4m_*^kuW{#jkhfl|OvP+mfY!gA$NFKc#_|3~J~!ra z37XB=-lYu9f%g?^IWaF5;N-Sg6icY{;nXUAf}1J0m4e$TxDx|=eeGu%O80g%kRIZuhq&n>ZhDBD9^$5lxalEo zdWf4H;;zMezjcEtgs6+M4e;M@Fg%{PhOrydM52rdO{5W_C#29o#y5qfGCndKX5|HV zN8M33C0~s*hsypc=l>W7kLXs6?m(zCv{@;P!@`)rMLJSMWb_*0UQ7(gdsU_<0@-MT zNamjTfxq4M-i{X;4U}Kfs`0JK;>8B~1L~iQ7lfBk9DY((zHolfAhxMg>EJH)*?>{9 zg=)Bb1*wUY)Xl`y0DTCx`-WUa@+Ue+Bo2fjp>!5nxd}>#^@`GIo%v)wk-7JnALd)m zpwQ<;LR!Uyt`!Ae1dj*FP~>c=bC%7^pEJ)PGqy?#Y?jCgC>^ark0lDq^f^(4=}V%l zOkX5(E0a%E6>%7SM0$s6m{i990nmtO+UP3vkt0_0m{Gi>4mDFJl(~ugH8sD0sFWk) zp!>{|zoj0<5|uL$dx*2?IP6khoe0i`1j$!kBV8IfFCc%7!8p0X{6r8Pjp*TuR_32* zH!0cv>%@s&LNP;n-}E6&uddwTPXJI8*ddJlLm1`?SYeTS!Fs1zIDI7&lGpRajLp3Yp9b&MaP z1Vrr|KF4QyQA4f8b*d4vP4irhD7KJlq?G()(Qd1MEFD}5L<=6mwO@hTDi<;*-ubcO zL~s>lJ+gmf_N3nl