commit dcaaf1efc4b727b1ce23e14024ea06404acf580f Author: Benjamyn Love Date: Mon May 29 22:25:59 2023 +1000 Initial diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..af699d0 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,16 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": "Python: Current File", + "type": "python", + "request": "launch", + "program": "~/Documents/Projects/PyGameTuts/better_tutorial/game.py", + "console": "integratedTerminal", + "justMyCode": true + } + ] +} \ No newline at end of file diff --git a/Images/L1.png b/Images/L1.png new file mode 100644 index 0000000..a7b6bff Binary files /dev/null and b/Images/L1.png differ diff --git a/Images/L10E.png b/Images/L10E.png new file mode 100644 index 0000000..7d93dc3 Binary files /dev/null and b/Images/L10E.png differ diff --git a/Images/L11E.png b/Images/L11E.png new file mode 100644 index 0000000..099b4d0 Binary files /dev/null and b/Images/L11E.png differ diff --git a/Images/L1E.png b/Images/L1E.png new file mode 100644 index 0000000..93cddb7 Binary files /dev/null and b/Images/L1E.png differ diff --git a/Images/L2.png b/Images/L2.png new file mode 100644 index 0000000..d5e39eb Binary files /dev/null and b/Images/L2.png differ diff --git a/Images/L2E.png b/Images/L2E.png new file mode 100644 index 0000000..54f374b Binary files /dev/null and b/Images/L2E.png differ diff --git a/Images/L3.png b/Images/L3.png new file mode 100644 index 0000000..d6e461b Binary files /dev/null and b/Images/L3.png differ diff --git a/Images/L3E.png b/Images/L3E.png new file mode 100644 index 0000000..faa8627 Binary files /dev/null and b/Images/L3E.png differ diff --git a/Images/L4.png b/Images/L4.png new file mode 100644 index 0000000..22abf73 Binary files /dev/null and b/Images/L4.png differ diff --git a/Images/L4E.png b/Images/L4E.png new file mode 100644 index 0000000..3726b82 Binary files /dev/null and b/Images/L4E.png differ diff --git a/Images/L5.png b/Images/L5.png new file mode 100644 index 0000000..312501d Binary files /dev/null and b/Images/L5.png differ diff --git a/Images/L5E.png b/Images/L5E.png new file mode 100644 index 0000000..eb33e9a Binary files /dev/null and b/Images/L5E.png differ diff --git a/Images/L6.png b/Images/L6.png new file mode 100644 index 0000000..d5fd1b0 Binary files /dev/null and b/Images/L6.png differ diff --git a/Images/L6E.png b/Images/L6E.png new file mode 100644 index 0000000..00e62f5 Binary files /dev/null and b/Images/L6E.png differ diff --git a/Images/L7.png b/Images/L7.png new file mode 100644 index 0000000..be95d7a Binary files /dev/null and b/Images/L7.png differ diff --git a/Images/L7E.png b/Images/L7E.png new file mode 100644 index 0000000..6faff79 Binary files /dev/null and b/Images/L7E.png differ diff --git a/Images/L8.png b/Images/L8.png new file mode 100644 index 0000000..6270243 Binary files /dev/null and b/Images/L8.png differ diff --git a/Images/L8E.png b/Images/L8E.png new file mode 100644 index 0000000..53d427f Binary files /dev/null and b/Images/L8E.png differ diff --git a/Images/L9.png b/Images/L9.png new file mode 100644 index 0000000..dfdc7a9 Binary files /dev/null and b/Images/L9.png differ diff --git a/Images/L9E.png b/Images/L9E.png new file mode 100644 index 0000000..c98db88 Binary files /dev/null and b/Images/L9E.png differ diff --git a/Images/R1.png b/Images/R1.png new file mode 100644 index 0000000..f588320 Binary files /dev/null and b/Images/R1.png differ diff --git a/Images/R10E.png b/Images/R10E.png new file mode 100644 index 0000000..089d3c0 Binary files /dev/null and b/Images/R10E.png differ diff --git a/Images/R11E.png b/Images/R11E.png new file mode 100644 index 0000000..5460db0 Binary files /dev/null and b/Images/R11E.png differ diff --git a/Images/R1E.png b/Images/R1E.png new file mode 100644 index 0000000..664b26a Binary files /dev/null and b/Images/R1E.png differ diff --git a/Images/R2.png b/Images/R2.png new file mode 100644 index 0000000..8e5a4bf Binary files /dev/null and b/Images/R2.png differ diff --git a/Images/R2E.png b/Images/R2E.png new file mode 100644 index 0000000..081f401 Binary files /dev/null and b/Images/R2E.png differ diff --git a/Images/R3.png b/Images/R3.png new file mode 100644 index 0000000..2b0c47f Binary files /dev/null and b/Images/R3.png differ diff --git a/Images/R3E.png b/Images/R3E.png new file mode 100644 index 0000000..00d7604 Binary files /dev/null and b/Images/R3E.png differ diff --git a/Images/R4.png b/Images/R4.png new file mode 100644 index 0000000..e4f9891 Binary files /dev/null and b/Images/R4.png differ diff --git a/Images/R4E.png b/Images/R4E.png new file mode 100644 index 0000000..0d17f8f Binary files /dev/null and b/Images/R4E.png differ diff --git a/Images/R5.png b/Images/R5.png new file mode 100644 index 0000000..b98ff30 Binary files /dev/null and b/Images/R5.png differ diff --git a/Images/R5E.png b/Images/R5E.png new file mode 100644 index 0000000..9ebad1a Binary files /dev/null and b/Images/R5E.png differ diff --git a/Images/R6.png b/Images/R6.png new file mode 100644 index 0000000..b1e8505 Binary files /dev/null and b/Images/R6.png differ diff --git a/Images/R6E.png b/Images/R6E.png new file mode 100644 index 0000000..1c6b5ad Binary files /dev/null and b/Images/R6E.png differ diff --git a/Images/R7.png b/Images/R7.png new file mode 100644 index 0000000..c5e4764 Binary files /dev/null and b/Images/R7.png differ diff --git a/Images/R7E.png b/Images/R7E.png new file mode 100644 index 0000000..bbddfbe Binary files /dev/null and b/Images/R7E.png differ diff --git a/Images/R8.png b/Images/R8.png new file mode 100644 index 0000000..ff7856e Binary files /dev/null and b/Images/R8.png differ diff --git a/Images/R8E.png b/Images/R8E.png new file mode 100644 index 0000000..12f1034 Binary files /dev/null and b/Images/R8E.png differ diff --git a/Images/R9.png b/Images/R9.png new file mode 100644 index 0000000..e85ca73 Binary files /dev/null and b/Images/R9.png differ diff --git a/Images/R9E.png b/Images/R9E.png new file mode 100644 index 0000000..86022d1 Binary files /dev/null and b/Images/R9E.png differ diff --git a/Images/bg.jpg b/Images/bg.jpg new file mode 100644 index 0000000..fa9fef9 Binary files /dev/null and b/Images/bg.jpg differ diff --git a/Images/standing.png b/Images/standing.png new file mode 100644 index 0000000..2b6bdda Binary files /dev/null and b/Images/standing.png differ diff --git a/Music/music.mp3 b/Music/music.mp3 new file mode 100644 index 0000000..a1418b8 Binary files /dev/null and b/Music/music.mp3 differ diff --git a/game.py b/game.py new file mode 100644 index 0000000..13663ab --- /dev/null +++ b/game.py @@ -0,0 +1,59 @@ +import pygame +pygame.init() + +win = pygame.display.set_mode((500, 500)) +pygame.display.set_caption("First Game") + +# Shit vars +x, y = 50, 50 +width, height = 40, 60 +vel = 5 +isJump = False +jumpCount = 10 + +# Animation Vars +left = False +Right = False +walkCount = 0 + +# https://www.techwithtim.net/tutorials/game-development-with-python/pygame-tutorial/pygame-animation + +walkRight = [pygame.image.load] + +run = True + +while run: + pygame.time.delay(100) + 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 + if keys[pygame.K_RIGHT] and x < 500 - vel - width: + x += vel + + if isJump is False: + if keys[pygame.K_UP] and y > vel: + y -= vel + if keys[pygame.K_DOWN] and y < 500 - height - vel: + y += vel + if keys[pygame.K_SPACE]: + isJump = True + else: + if jumpCount >= -10: + y -= (jumpCount * abs(jumpCount)) * 0.5 + jumpCount -= 1 + else: + jumpCount = 10 + isJump = False + + win.fill((0, 0, 0)) + pygame.draw.rect(win, (255,0,0), (x, y, width, height)) + pygame.display.update() + + + +pygame.quit() \ No newline at end of file