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