Pygame Tutorial #10 - Finishing Touches & Next Steps

Tech With Tim · Beginner ·🛠️ AI Tools & Apps ·8y ago

Key Takeaways

Pygame tutorial covering bug fixes and next steps in game creation, utilizing Pygame library and tools

Full Transcript

hey guys and welcome back to another YouTube video so in today's video I'm going to be doing the tenth and final video in my PI game programming series or tutorials and in today's video we're gonna be talking about finishing up the game fixing a few bugs that I've discovered since the last video and that you guys have probably found as well if you've been running the program and we're gonna be talking about what the next steps are and what we can expect to see from here and where we can go after having knowledge that we've learned from this tutorial so first of all if you guys have made it all the way to video 10 and are watching this give yourself a pat on the back that's very impressive that you've been able to sit through 10 10 to 15 minute long videos and you've now created something that's pretty impressive as a first game or just a starter a project to start a learn high game so if you've been able to understand even just some of what I've shown in here then that's a really good sign and you guys are gonna be able to create more advanced games later on by following more tutorial guides so I'm gonna be doing so pretty much I'm just gonna start off right now by fixing a few bugs and I'll show those bugs to you right now and this is what happens when you're developing games so when you develop games you're gonna notice that you can't possibly think of every scenario that's gonna happen for example a bug that's in this game is while I'm jumping if I hit the Goblin you'll see that our character goes down below the screen now the first thing we need to do to fix this bug is to figure out why it's happening now the reason that this bug happens and it took me about a few minutes to figure it out is because while we're in midair what ends up happening is we run the player hit method here right which resets our Y to ground level so for 10 now after we reset the y we don't stop jumping meaning that although our character doesn't appear as though they are moving downwards from jumping the jump code that we have in our while loop that moves our character downwards Hank it's like let's see here somewhere down here yeah so if man is jumping it's still moving our character downwards so we move it to 410 and then since we're still jumping we move down another like 50 pixels which makes our character head just barely visible at the bottom of the screen so the way to fix this just to go into our man dot hip method which is I believe right here and just at the very beginning we're gonna say self dot is jump is equal to false and I'm going to say self dot jump count I'm just gonna reset that to the original value which we had of ten I believe still would check that yep so jump count is 10 and is jump equal to false so this way it just got stopped our jump so that we shouldn't be going down so let's test this and just make sure that it's working alright just give me a second here so let's wait for them to come back jump up and there we go so you can see now our character does not go below the screen we'll test it one more time to make sure it's working and everything seems to be okay now another bug I ran into I'm gonna have to show you quickly here is once the Goblin disappears watch this I'm just gonna run around and you see it's still collides with the gulp and so although we can't see the gulp than he actually is running around right now he should hit me in just about a second now yeah because he's over there so we need to make sure that our character is not able to collide with the Goblin while the Goblin is well destroyed right so once we kill him obviously we don't want to still be able to collide with him because right now what what ends up happening is we just make the enemy invisible we don't actually like remove it from the screen so it's still moving around in the background we just can't see it so it's pretty easy to fix this we're just gonna go down to where we have the collision between our Goblin and our player and we're going to create another if loop up here if statement or just gonna say if goblin I believe that's what I called him yep thought visible equals equals true there we go we can indent all this just by hitting tabs that should work there we go and now it's only going to allow the collision between the two characters if the Goblin is visible now I'm just going to double check to make sure that is the property I used visible yes so now we can see if I around the program let's make sure this is working I'm just gonna oops just gotta make sure we kill this Galvin first and then we can see that now that the golden is invisible I can clearly run across the screen and I'm not no longer colliding with the gaulden because well we destroyed you right so that's a quick fix at a plug now the other bug I noticed was the score up here so once this becomes a negative number it starts to move off the screen now this is a really easy fix all I'm gonna do for this is simply just move where we're drawing the the text so if we go to our redraw game window function believe that's where we draw the text all I'm gonna do is just move it back and the X by a boat let's say like 40 50 pixels maybe and now if we draw it and we get hit you can see that it's gonna say negative 5 and it's no longer going off the screen now you guys can play with that if you want to move it closer to the right close to the left etc and yeah so that's about it for the bugs that I found I'm sure there's probably a few more that you guys can think of for right now that's all we've got so now I'm just gonna go in and talk about next steps so pretty much the next steps for us and for this program is to now create a more original game or to create just better games in general so this was kind of not really a game more it's just a starter project just to kind of learn some of the different attributes of Pi game and how it works so how two objects can collide with each other how we can have sound effects play how we can have bullets shooting out of a character so I really tried to make it pretty diverse in the way that I showed well how to use a class how to use methods so that you guys if you wanted to create your own game you would have the tools to do so from just using this tutorial series that I've done here so that's why if you're looking at the game now you're kind of like well in 10 videos we didn't really accomplish too much this isn't really a great game I don't want to show this to my friends whatever but all I'm trying to do here was just show you the different tools that you could use so what I'm gonna be doing on this channel is I'm going to be posting way more specific videos now so now that I have this general tutorial series done I think I'm going to be doing a video on for example how to code hi our pac-man in pagi how to code like a shooter game so like you know if you I'm not sure if you guys know the asteroid asteroids game I'm not sure what it's called you have a little plane that comes here and enemies shoot down and come down the screen and you have to shoot them before they hit you or the edge of the screen I'm gonna be showing how to do videos like that and then for all these videos what I'm going to be doing is I'm just gonna sit down and record them all in one sitting so I'll record like an hour hour and a half and then I'll break that up into two or three videos and I'll post them within a few days so that way unlike this series where you guys had to wait for a long time to see the videos they'll come out right away so you can follow along with them instantly so if you guys want to see videos like that make sure you subscribe to the channel and you hit the like button on this video and if you have any ideas on games that you want to see how to program and I see a popular vote if you guys see anything down in the comments below and you want to see a video not too make sure you like the comment because I obviously want to be making videos that you guys want to watch and that you guys want to learn how to do so if you have any ideas make sure you leave them down below and that's been it for this video so I'll see you guys in the next tutorial series [Music]

Original Description

This is the FINAL video In my pygame series. In this video I fix a few bugs that I discovered while creating this game and I talk about the next steps in your game creation journey. I would like to thank everyone for all the positive feedback I've received on this series and I will be sure to make more tutorial series on game creation in python with pygame. Make sure you hit that subscribe button to be notified when I do so. Download Code: https://techwithtim.net/tutorials/game-development-with-python/pygame-tutorial/pygame-tutorial/ Twitter: https://twitter.com/TechWithTimm Please leave a LIKE and SUBSCRIBE for more content! Tags: - Tech - Tech With Tim - Crypto - Programming - Coding - Python - Pygame - Game Development
Sign in to unlock AI tutor explanation · ⚡30

Playlist

Uploads from Tech With Tim · Tech With Tim · 50 of 60

1 A* Path Finding Algorithm(Visualization)
A* Path Finding Algorithm(Visualization)
Tech With Tim
2 Python Programming Tutorial #1 - Variables and Data Types
Python Programming Tutorial #1 - Variables and Data Types
Tech With Tim
3 Python Programming Tutorial #2 - Basic Operators and Input
Python Programming Tutorial #2 - Basic Operators and Input
Tech With Tim
4 Python Programming Tutorial #3 - Conditions
Python Programming Tutorial #3 - Conditions
Tech With Tim
5 Python Programming Tutorial #4 - IF/ELIF/ELSE
Python Programming Tutorial #4 - IF/ELIF/ELSE
Tech With Tim
6 Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Python Programming Tutorial #5 - Chained Conditionals and Nested Statements
Tech With Tim
7 Python Programming Tutorial #6 - For Loops
Python Programming Tutorial #6 - For Loops
Tech With Tim
8 Python Programming Tutorial #7 - While Loops
Python Programming Tutorial #7 - While Loops
Tech With Tim
9 Python Programming Tutorial #8 - Lists and Tuples
Python Programming Tutorial #8 - Lists and Tuples
Tech With Tim
10 Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Python Programming Tutorial #9 - Iteration by Item (For Loops Continued...)
Tech With Tim
11 Python Programming Tutorial #10 - String Methods
Python Programming Tutorial #10 - String Methods
Tech With Tim
12 How to Overclock a NVIDIA GPU
How to Overclock a NVIDIA GPU
Tech With Tim
13 Python Programming Tutorial #11 - Slice Operator
Python Programming Tutorial #11 - Slice Operator
Tech With Tim
14 Python Programming Tutorial #12 - Functions
Python Programming Tutorial #12 - Functions
Tech With Tim
15 Python Programming Tutorial #13 - How to Read a Text File
Python Programming Tutorial #13 - How to Read a Text File
Tech With Tim
16 Python Programming Tutorial #14 - Writing to a Text File
Python Programming Tutorial #14 - Writing to a Text File
Tech With Tim
17 Python Programming Tutorial #15 - Using .count() and .find()
Python Programming Tutorial #15 - Using .count() and .find()
Tech With Tim
18 Python Programming Tutorial #16 - Introduction to Modular Programming
Python Programming Tutorial #16 - Introduction to Modular Programming
Tech With Tim
19 Python Programming Tutorial #17 - Optional Parameters
Python Programming Tutorial #17 - Optional Parameters
Tech With Tim
20 Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Python Programming Tutorial #18 - Try and Except (Python Error Handling)
Tech With Tim
21 Python Programming Tutorial #19 - Global vs Local Variables
Python Programming Tutorial #19 - Global vs Local Variables
Tech With Tim
22 Python Programming Tutorial #20 - Classes and Objects
Python Programming Tutorial #20 - Classes and Objects
Tech With Tim
23 Cool VBS Script to Prank Your Friends!
Cool VBS Script to Prank Your Friends!
Tech With Tim
24 How to Overclock an AMD GPU
How to Overclock an AMD GPU
Tech With Tim
25 Best GPU'S For Mining Ethereum (2018)
Best GPU'S For Mining Ethereum (2018)
Tech With Tim
26 Recursion and Memoization Tutorial Python
Recursion and Memoization Tutorial Python
Tech With Tim
27 Ethereum Mining Rig - Hardware Guide
Ethereum Mining Rig - Hardware Guide
Tech With Tim
28 Pygame Tutorial #1 - Basic Movement and Key Presses
Pygame Tutorial #1 - Basic Movement and Key Presses
Tech With Tim
29 How to Install Pygame (Windows 8/10)
How to Install Pygame (Windows 8/10)
Tech With Tim
30 How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
How to Trade Your Cryptocurrency (Bitcoin, Ethereum etc.) For Cash!
Tech With Tim
31 How to Mine Ethereum 2018 - WORKING (Super-Easy)
How to Mine Ethereum 2018 - WORKING (Super-Easy)
Tech With Tim
32 Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Microphone Comparison - $10 Mic vs $150 Mic (Blue Yeti USB)
Tech With Tim
33 Pygame Tutorial #2 - Jumping and Boundaries
Pygame Tutorial #2 - Jumping and Boundaries
Tech With Tim
34 Pygame Tutorial #3 - Character Animation & Sprites
Pygame Tutorial #3 - Character Animation & Sprites
Tech With Tim
35 Pygame Tutorial #4 - Optimization & OOP
Pygame Tutorial #4 - Optimization & OOP
Tech With Tim
36 OBS Studio Tutorial - Best OBS Settings
OBS Studio Tutorial - Best OBS Settings
Tech With Tim
37 Linear Search Algorithm - Python Example and Code
Linear Search Algorithm - Python Example and Code
Tech With Tim
38 Make Any Mic Sound AMAZING! (WITH OBS)
Make Any Mic Sound AMAZING! (WITH OBS)
Tech With Tim
39 Binary Search Algorithm - Python Example & Code
Binary Search Algorithm - Python Example & Code
Tech With Tim
40 Pygame Tutorial #5 - Projectiles
Pygame Tutorial #5 - Projectiles
Tech With Tim
41 Pygame Game - Mini Golf
Pygame Game - Mini Golf
Tech With Tim
42 Pygame Tutorial - Projectile Motion (Part 1)
Pygame Tutorial - Projectile Motion (Part 1)
Tech With Tim
43 Pygame Tutorial - Projectile Motion (Part 2)
Pygame Tutorial - Projectile Motion (Part 2)
Tech With Tim
44 Pygame Tutorial #6 - Enemies
Pygame Tutorial #6 - Enemies
Tech With Tim
45 Pygame Tutorial #7 - Collision and Hit Boxes
Pygame Tutorial #7 - Collision and Hit Boxes
Tech With Tim
46 Pygame Tutorial #8 - Scoring and Health Bars
Pygame Tutorial #8 - Scoring and Health Bars
Tech With Tim
47 Cloud Mining vs. Hardware Mining - 2018
Cloud Mining vs. Hardware Mining - 2018
Tech With Tim
48 How to Install Pygame on Mac OSX (Fast-Simple)
How to Install Pygame on Mac OSX (Fast-Simple)
Tech With Tim
49 Pygame Tutorial #9 - Sound Effects, Music & More Collision
Pygame Tutorial #9 - Sound Effects, Music & More Collision
Tech With Tim
Pygame Tutorial #10 - Finishing Touches & Next Steps
Pygame Tutorial #10 - Finishing Touches & Next Steps
Tech With Tim
51 How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
How to Fade Your Screen in Pygame [CODE IN DESCRIPTION]
Tech With Tim
52 How to Create a Button in Pygame [CODE IN DESCRIPTION]
How to Create a Button in Pygame [CODE IN DESCRIPTION]
Tech With Tim
53 Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Pygame Side-Scroller Tutorial #1 - Scrolling Background/Character Movement
Tech With Tim
54 Pygame Side-Scroller Tutorial #2 - Random Object Generation
Pygame Side-Scroller Tutorial #2 - Random Object Generation
Tech With Tim
55 Pygame Side-Scroller Tutorial #3 - Collision
Pygame Side-Scroller Tutorial #3 - Collision
Tech With Tim
56 Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Pygame Side-Scroller Tutorial #4 - Scoring and End Screen
Tech With Tim
57 How to Create A Message Box in Python - Tkinter
How to Create A Message Box in Python - Tkinter
Tech With Tim
58 Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Is Ethereum Mining Still Profitable - Is It Worth It (April 2018)
Tech With Tim
59 How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
How to Run MAC OSX on a WINDOWS PC (Clover Boot-loader)
Tech With Tim
60 Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Programming Problem #1 - Alphabet Soup (Beginner/Novice)
Tech With Tim

This Pygame tutorial covers fixing bugs and discussing next steps in game creation, providing a comprehensive guide for beginners to improve their game development skills

Key Takeaways
  1. Fix bugs in the game
  2. Improve game performance
  3. Design game layouts
  4. Create a game plan
  5. Test and debug the game
💡 Fixing bugs and optimizing performance are crucial steps in game development

Related Reads

📰
Otter vs MeetingMinutes: Which AI Meeting Recorder Should You Choose?
Choose the best AI meeting recorder for your needs by comparing Otter and MeetingMinutes beyond transcription capabilities
Dev.to AI
📰
How are you handling AI exhaustion?
Learn how to manage AI exhaustion by automating tasks and prioritizing accountability, and discover strategies for handling the pressure of increased workload with less human oversight.
Dev.to AI
📰
How Can a Beginner Use AI to Start Making Money Online?
Learn how to leverage AI for online income as a beginner, exploring tools and business models for monetization
Medium · AI
📰
AI writing tools pricing compared (2026-08) - 8 tools, tracked daily
Compare pricing plans of 8 AI writing tools to make informed decisions for your content creation needs
Dev.to AI
Up next
How to Get Your Brand Cited by ChatGPT, Claude and Gemini
Arvow
Watch →