Here's a tip: VSCode shows the current object and function I'm editing right under the file tabs, which can help you keep track of where I am at all times. Clarification: If you have larger entities, they need to look up a larger area of tiles around them for physics. I used a 3x3 table in the tutorial, but you may need a larger one for large entities. A 5x5 table would be every pair of numbers between -2 and 2. (3x3 is -1 to 1) As of the release of this tutorial, I'm still using Pygame CE. They've actually released another update since I started working on this video as well!
@rubendriezen7177 Жыл бұрын
I made my own programming language in python!
@herikgiammaria9961 Жыл бұрын
I love your work!! I love love love it, I study pygame for your videos and I try to improve every day! Could you put subtitles in this video of yours? I'm Brazilian and I don't understand your videos very well when they don't have subtitles
@DaFluffyPotato Жыл бұрын
@@herikgiammaria9961 I think KZbin may still be processing the automatic subtitles. There's no way I could write up manual subtitles for a 6 hour video though. I just do manual English ones for my scripted videos now since I can just put in the script. Also, I'm impressed that the automatic ones are useful since it often doesn't understand what I'm saying.
@herikgiammaria9961 Жыл бұрын
@@DaFluffyPotato Thank you very much!!!! I thought so haha, after all it's a 6 hour video! KZbin must be processing, I'll come back to watch it later! MT thanks for helping this community to grow, I appreciate you and your work, hugs
@AndrewHTR Жыл бұрын
@@herikgiammaria9961 salve herik
@thes_ntry Жыл бұрын
You are a wizard of using Pygame, your previous tutorials were amazing, and the amount you've been able to build up around the library is immensely impressive. Thank you for sharing your experience and insight to everyone
@Z3gn1c Жыл бұрын
Just finished this amazing tutorial, took me about 4 days though spent about 18hours on it. But it was worth every second! This is the first time I actually worked with Pygame, and after your tutorial, I definitely have quite a few ideas of what I can do on my own. Will be checking out your other tutorials as well. Thanks for some amazing content !
@sricharanathanti318110 ай бұрын
This guy has to go down in the books as the best Python game developer.
@emperor8716 Жыл бұрын
this is crazy. a tutorial from the actual best, i can't wait to do this.
@stephan199127103 ай бұрын
I am exactly halfway in after 3 days, and I can't believe this is on KZbin for free... It's amazing for beginner/intermediate level. Thank you so much for this
@АлексейШтейников-ц4ц Жыл бұрын
I think you are the only developer who works so hard on making games in python, knowing that it was easier to do it in unity. You really inspire me a lot.
@DaFluffyPotato Жыл бұрын
It's only easier to get started learning with Unity. At my level, I can work faster than people using Unity.
@chigstardan7285 Жыл бұрын
@@DaFluffyPotato That's so cool.
@sushismitcher225 Жыл бұрын
I have been using pygame for over a year, and I've made over 20 pygame snippets in vs code to make anything in pygame from particles to a basic platformer. This lets me make prototypes faster than with a game engine. Each method to making a game has its advantage.
@Man-mx2sy Жыл бұрын
nah check out clear code, that dudes fire
@chigstardan7285 Жыл бұрын
@@Man-mx2sy man clear code is the best, though he uses pygame for educational material while fluffy uses it for his personal projects. I hear clear code is gonna bring a new Godot 4 tutorial.
@ZaynBrando10 ай бұрын
This is actually the best video i've ever seen that explains things very easily for a beginner and helped me understand the "WHY" behind every code. Thank you so much, subbed!
@SagaContinu10 ай бұрын
If anyone runs into an issue with their character falling through the floor: Collision detection is checking where you are located in the a grid system ---> that's what the tiles_around() function does. It uses the co-ordinates from the top left of your player image to workout where you are. If your player image is larger that the grid system it will only register that you are in the next grid section to update the collisions after you have fallen through the floor. Try checking from the center of the image instead. Or else you may need to do more than one check i.e. top left, bottom right. Or else increase the checking distance to include more tiles. Interesting way to do the collision detection though
@HammouaI0I0I07 ай бұрын
how to do this btw
@SagaContinu7 ай бұрын
@@HammouaI0I0I0 Adjust tilemap.physics_rect_around() function to check from the center of the player instead of the top left player_loc = self.game.player.rect().center However, if the distance from the center of the image to the sides (right,left,top,bottom) is still greater than a tile width this won't work.
@HammouaI0I0I07 ай бұрын
@@SagaContinu cool, but where do i insert this line of code edit: cool my player doesn't fall trough the wall, but its sometilmes glitch out with upper collisions
@IfYouEscapedYTKidsIWillGetYou12 күн бұрын
@@HammouaI0I0I0 by learning pygame and python
@galaxybrainnews9772 Жыл бұрын
After the optimizations around 1:52:15 I adjusted the tilemap __init__ to add a million tiles in each direction instead of just 10. it took a while for the project to start but even with 2 million tiles loaded into the tilemap it was still buttery smooth once it got going! (Using python 3.12 and pygame ce as of 11/9/2023)
@DaFluffyPotato Жыл бұрын
Yep, that's expected. You can have some pretty massive worlds. Often times RAM will become an issue before CPU usage in those cases (provided you don't have too much on the screen at once).
@lucaivaldi45206 ай бұрын
@@DaFluffyPotato I wonder if the optimization is more about not having to query the whole dict more than queuing a lot of draw calls. Of course premature optimization is the root of all evil and we should always benchmark before trying to optimize. I think the SDL library (and the backend it uses, Opengl, Metal, Vulkan..) will be more than happy to discard any draw call that draws off the screen, but there is the cost of querying the whole dictionary anyway, so your solution could cut the time spent there. Anyway, I'm not sure how much of an issue that could be. Anyway, this is only something I'm asking myself and your videos are super, thank you!
@nilusnilus6365 Жыл бұрын
wow i remember a few years ago following your platformer tutorial, very glad to see you continuing the series :D
@DarkPlaysThings Жыл бұрын
Thanks so much for the great tutorials! It’s awesome to see your thought processes and see how you make such high quality experiences using python!
@gibran80010 ай бұрын
This smooth camera movement trick is fucking amazing. I had to go over the geometry of it a couple of times, but once it clicks, holy shit, it makes so much sense.
@VolarGorilla91719 күн бұрын
Words cant describe how thankful I am for this dude. I love coding, and i also love playing video games. I wanted to get into game dev and i have made a few games and have worked with a few pathfinding algorithms (i implemented Dijkstra's GBFS and A* in snake and a cool little maze solver), I wanted to get into making better games, making platformers specifically. But I was never able to get past making a player move around, I'd always struggled with the scope of the project and the concepts of how to make my own tilemap / tile editor and I especially struggled with collisions using tiles. Ur a wizard dude, some of these solutions u came up with to the problems i struggled with are so simple. I really appreciate you making this long tutorial that explains all of the code and even the math, most tutorials dont bother explaining the math, they just say "oh this is just how you do this". They dont bother to explain what it is or how it can be applied, and that goes for all of the code. I love that you stopped, backed up for a second and explained the code, how you can change it, and several different applications for the code. Sorry for rambling dude im just really thankful.
@jumparoundtheatoms Жыл бұрын
Awesome stuff you did sharing this , many thanks :) . One thing for those who made it to enemies :P : while DaFluffyPotato does mention and switches to off grid placement for the player ( and subsequent the enemies ), if one does place the spawners by accident on grid like me, extract will fail. This is because the spawners are not part of self.offgrid_tiles, but self.tilemap, and the loop in the extract function its done on the self.tilemap directly and not on a copy. Reckon by accident and the loop should be done on a copy to catch this cases.
@Nolexes7 ай бұрын
I totally overheard the offgrid part couldn't get my game running anymore and got different kind of errors trying to fix it so thanks for the comment. I bet it would have taken me ages to find this out on my own :D
@fuzzy-024 ай бұрын
I loved this tutorial because I wanted to learn practices, techniques and general tips on how to write the code, more so than learning the syntax which can be easily found from the docs. I was happy when you shared how you do things and how you write them every now and then. Thank you so much!
@PeterDinklager Жыл бұрын
Around 32:34 a good practice is to stop and try to code in left and right movement, then add a collision box on each side at equal distances. Helped me understand the code and get a better grasp for placing things in relation to the resolution
@sc2sperwerfy24910 ай бұрын
hey, do you know witch event i have to use for the key right and key left? I cant find them in python. thanks
@kuba.91089 ай бұрын
@@sc2sperwerfy249just normal eventtype K_UP or K_DOWN i belive
@StayInNeverland15 ай бұрын
@@sc2sperwerfy249 K_LEFT and K_RIGHT
@LemmonTeaАй бұрын
I figured out how to add left and right, it was actually cool to try and figure it out on my own
@JamieKilduff Жыл бұрын
So happy this was uploaded, couldn't find a better person to explain pygame then this legend, Well done Potato keep killing it
@curiousstudent7961 Жыл бұрын
my coding got so much cleaner from using this as a guideline, thanks!
@Plexus372 ай бұрын
Awesome, thanks man. Just started with Python after 30+ years of doing nothing. I learnt Pascal, COBOL and C at college, its coming back quicker than I expected but a way to go.
@lustrias Жыл бұрын
Amazing tutorial. I've tried a few others, but this one is just what I needed. I do deviate here and there from your code. I added vsync to the window. But vsync only works with the flag pygame.SCALED. So I removed your method of scaling (drawing a 320*240 surface and then upscale it in the main window). The amount of experience and information you give is really impressive. Thank you so much👍
@paranimias9 ай бұрын
on 2020 you totally saved my butt on my programming project with your first tutorial, I'm really glad that you keep posting this tutorials, greeting from Colombia!
@DerpyDungeoneer Жыл бұрын
I almost cried not finding that typo that didn't let me start the game at the end of the cloud part. Dude I love your insights you give into various methods of handling stuff. Super abstract thinking. I aspire to get on that level at some point. This is my first step into game development. Hope I get my mind primed the right way following your thought process.
@FaunFunc11 ай бұрын
i just migrated to pygame from html and js canvas, am skimming through this tutorial and it's very fun. Learning OOP for games is really worth it🙂
@Programmer-Anchous Жыл бұрын
This is the best pygame platformer tutorial I've ever seen! Thank you!
@musaplusplus Жыл бұрын
God damn Fluffy , you really went in with this one
@official-phuh6 ай бұрын
I've been trying not to comment until the end of the video, but right now I'm in the middle of making the Level Editor and I just have to say, things are really starting to click and I'm really grateful for your teaching style, optimization/pragmatism/problem solving, and effort to make this tutorial. I'm changing things around too as to really push myself to understand your code more thoroughly (for example I used a sprite sheet that needs coordinates instead of files for the Level Editor, which required a fair bit of tweaking across multiple files).
@RAM-nb1ot Жыл бұрын
I was literally following your old pygame tuts and if they werent alr a blessing we got this :) thanks man
@daniehexer7016 Жыл бұрын
It's great seeing your tutorials, can't wait to try this myself!
@moanzx2 Жыл бұрын
this has helped me so much now im hooked on your videos :) also remade my platformer im working on thanks to so many of your techniques. and joined the discord and there are so many helping people there! looking forward of what your'e gonna do next! 😊
@isaiah36135 ай бұрын
thank you for making this can't believe i finally made it through this "7" hour tutorial
@jasonfun40696 ай бұрын
I learned more from this tutorial than my past 2 years of python classes
@willwillcode7568 Жыл бұрын
Finally, a good tutorial on pygame! Thanks so much
@DevNug Жыл бұрын
This seems like a good approach for people who already know how to program. Honestly some of the APIs seem similar to normal web dev. I guess at the end of the day, game dev is still just listening for events, updating state and rendering to the display
@cursorop171611 ай бұрын
at 1:33:00 if you divide self.scroll by 30 then the camera follow up will be slow . If you jump from high distance your player will fall first and camera wouldn't be able to follow up player , so divide it by 20 so no matter how high you jump the camera will follow up player in slow manner but without losing its track .
@anameanother35572 ай бұрын
thank you so much
@justin7oo994 Жыл бұрын
This is actually really cool, I have never seen anyone use Json files for loading maps I have only used csv files that's such a neat trick, also another neat trick for even more performance, use orjson instead of normal json its much faster
@carrotsandcats Жыл бұрын
Thank you so much for this, it’s so cool that you « remade » your old tutorial séries and improved it!! Thx
@tahsinahmed75855 ай бұрын
I really appreciated the video! if i can add something is whenever you are explaining a concept, visualizing the physics with drawing on a white board would really help reinforce the explanation.
@DaFluffyPotato5 ай бұрын
The full physics video I referenced has that.
@tahsinahmed75855 ай бұрын
@@DaFluffyPotato The video with the drawing was very well explained! I wish we could have seen more concepts in that format.For example , before coding certain topics such as camera movement ,and tiles creation, you often start explaining your thought process. I wish we could have seen some visual representation on those thoughts because words can be overwhelming. Other than that I loved the A to Z tutorial! Thank you so much for the content.
@bini420 Жыл бұрын
I did not expect a banger like this from you, I went from "oh new 10 minute video of his old tutorial" to "course? So 1 hour? That's unexpected" to "bros brain turned to mash patatos of he done this"
@q1chen Жыл бұрын
i literally said wow at the jumping part, genius idea
@ZedTheThrid3 ай бұрын
13:20 To place an icon icon = pygame.image.load('Your file here. I recommend it being in the same folder, but u could also put the file path I think') pygame.display.set_icon(icon)
@prafultimbadiya9891 Жыл бұрын
Your graphics are AMAZING!! ❤❤
@arbitervildred8999 Жыл бұрын
you can actually do something about that camera bug when it gets closer to it's target, I believe you can target more of a radius of 5-10 pixel from the player origins, so once it gets closer to the player it will stop trying to center it perfectly and avoid the bug (but of course, the player will be slightly offset by 5-ish pixels) OR when it gets to that 3-5 close pixels, suddenly speed the camera from 30 to 100 so it gets spot on in maximum 2 frames (about 1:35:50)
@khushankgalgat11 ай бұрын
hey, can you please tell what camera bug are you talking about? i didnt understood what "choppy" movement sir is talking about? Please explain that bug in some detail.. Thank You Have a nice day!
@ekaterinamalinkina38999 ай бұрын
What a great tutorial! Clear, concise, and not tiring to watch :) feel like i got a lot from this, thanks
@joshbarros1995 Жыл бұрын
Oh my god!!! its soooo perfect!!! I'll take this tutorial this Saturday!!!
@naturep1x3ls Жыл бұрын
the ultimate pygame tutorial has arrived.
@joshuarose20 Жыл бұрын
*HOW IS THIS FREE*
@drewfrench87842 ай бұрын
I believe the top left thing for graphic graphing came from how old televisions would illuminate the screen
@jureej2 ай бұрын
Bro u are so Talented and Everything I know this is 1 year old but how long are u programming this is so Impresive Clap Clap!!!!
this is an amazing tutorial! i learned a ton from it! i just want to let you know is that this project has a bug in the way you implemented the death by falling. if you wall-slide for too long it kills you, and for some reason in this project if you wall-slide for too long, it kind of glitches out and shakes the screen. I'm not too sure why that is. also, when you reloaded the level, the player's dash value is not reset. but i loved this tutorial and will be looking forward to more videos! thanks!
@wkol11206 ай бұрын
Hi DaFluffyPotato, through your teaching video, I learned about the python construction and many useful skill about game development! Especially on python container, it did help me a a lot to understand the syntax and tips. Thank you for your kindly sharing~~~
@Jioarg Жыл бұрын
This is a great tutorial. Some things I would like to see is a tutorial on a way to implement 3d isometric levels(editor and player) and menus and sprite sheets as assets. Thank you for all of your help.
@curlydev2 Жыл бұрын
THANK YOU SO MUCH, Thanks to you i achived my rpg engine, and it's so fast ! I'm really happy
@brianbrooks44485 ай бұрын
So you can load media assets as a dict ? self.assets = { 'player': load_image('entities/player.png') } wow , didn't know that. This is excellent stuff
@LemmonTeaАй бұрын
Yeah, me neither
@thisisnotkj Жыл бұрын
thank you for the great tutorial :D, will be watching it over the coming days!
@Cruzzz_Controlll8 ай бұрын
6 hour tutorial...218K views... only 6.7k likes... like the video peoples! "CAN I PET THAT DAWWWG?" No, but you can smash that like button :)
@q1chen Жыл бұрын
It took me several days to finish it and i really learned a lot, thanks!
@mobs93069 ай бұрын
Following this series with Zig and Raylib pretty similar experience except a lot of low level concerns.
@anantpankaj14603 ай бұрын
bro love this video and learned a lot from it ...just wanted to say plz make a multiplayer gamedev too for beginers like me ...cause the internet is full of pygame tutorial but none with pygame multiplayer and i will also become a aerospace engineer after high school..hope we will meet one day.😀
@LuicMarin3 ай бұрын
Loved the tutorial, hope we see one where we do some boss monster patterns
@wuziq4 ай бұрын
1:09:47 the double slash does floor division. the floor for negative numbers is more negative.
@mike_jay9 ай бұрын
Hi,thx for the tutorial. At the start there’s a cart racing game, I wondered if you have a series or video etc on writing that plz. Thx.
@parzival58844 ай бұрын
Holy shit dude u got my sub love the videos man keep up the good work! Im not a beginner but this helped me to brake that wall to be able to cold alone without the need of videos!
@thefunnyegg-fe8lr7 ай бұрын
thank you!! pygame is tricky but i'm determined to get it down!!
@TheLimbones8 ай бұрын
2:41:55 rock and stone
@asterix... Жыл бұрын
I've learned more from this video than I did from a year long class, how long have you been coding in general, if your first language wasn't Python?
@DaFluffyPotato Жыл бұрын
I started with Python and picked up Python shortly after in 2013.
@asterix... Жыл бұрын
@@DaFluffyPotato Dang, super impressive projects dude
@antonifakhry87025 ай бұрын
after that I thought I did not learn python; thought i learnt assembly lol everyday, 5 hours for a week. best time of my life!
@TarunThakur-go4qg Жыл бұрын
hello big fan i have created my own game thanks to you
@renatozr11 Жыл бұрын
This comment is the equivalent to 1 million likes, at least for my heart.
@FrankieDev8 ай бұрын
each like on this is another million so you have provided 63 million likes so far now
@LawrenceAaronLuther7 ай бұрын
You said it. What a wonderful gift this video is
@goodlookinouthomie17577 ай бұрын
Well I'm not writing a sonnet about it but I agree is was an awesome tutorial.
@agentnull52426 ай бұрын
100 million likes.
@MrBIizzard4 ай бұрын
Corny
@sopvop9 ай бұрын
Great video! I've learned a lot of basics about side scrollers, even though I'm following with c++ and raylib instead of python.
@ZgavY Жыл бұрын
I had like 90% of the knowledge in the video but I still watched all of it just for fun and I don't regret it :D
@LukaGantar Жыл бұрын
Thanks a lot for this, the tutorial is a great, comprehensive intro to pygame!
@chaitanyasannidhi99824 ай бұрын
Simply the best! Just a small thing, but when I was playing the finished game, I noticed that if I stick to the walls for too long, I die. I think this has to do with the air_time > 120 check. A simple fix would be changing the air_time value while we're wall sliding such that it doesn't go past 120. What do you think? Again, thanks for the awesome tutorial.
@Rafaeldonfigueiredo Жыл бұрын
It's another great tutorial, Fluffy. Thank you
@Chez19-f2x2 ай бұрын
Great video btw thank you so much and also answering my question !
@denstupakov2 ай бұрын
Good afternoon! This tutorial is very useful, I have learnt a whole lot. Thanks . Respect+
@elishashmalo3731 Жыл бұрын
Would you be interested in a colab? I absolutely love that you use pygame to make your projects. It’s the first graphics library I ever learned. I’m learning godot now just because I thought it would be fun. I think it would be interesting to see what a newb in godot could do vs what a pro in pygame could do.
@_am_i2 ай бұрын
Many thanks for this tutorial with detailed explanation and guidance!!!
@itdainb Жыл бұрын
Very good concept, as always, but I have a suggestion for you. Instead of returning an array or list in the function and then using a loop with that array, it would be better to use the 'yield' keyword in Python. This optimization will reduce the complexity to O(n) from the current 2*O(n). Additionally, you can further improve the performance by using NumPy to store numeric numbers and Numba to accelerate the loop.
@DaFluffyPotato Жыл бұрын
If you're talking about the nearby tiles thing, that's a maximum length of 9 with an average closer to 2.
@koufdell Жыл бұрын
Did u implement that? I would be interested to c how many fps u could gain
@squirre1_m4ster22 Жыл бұрын
how would we add our own assets? Also you are really good at programming and I really appreciate you making this video and so many others.
@DaFluffyPotato Жыл бұрын
The same way you load in and use the assets provided with the tutorial. The only difference is that you have to make them now.
@tortutute1707 Жыл бұрын
I don't comment much on videos, but thank you very much for your videos which help me a lot. Keep it up 🔥🔥! sorry for my english i am french
@ZaneBarrow16 күн бұрын
Have you considered making a video explaining what each component of pygame does and how it is used?
@DaFluffyPotato16 күн бұрын
I'm hoping to do that soon. It would be more useful for experienced developers learning Pygame.
@xyzxyz60957 ай бұрын
Man, you're a great gift for all of us wanting to learn to use pygame. Be Blessed and Successful in all your actions.Hope one day you'll come over and share a meal of fried potatoes 😀Salutations from France.
@vandorlokronika9581 Жыл бұрын
Great! I always want to learn pyhton (only know C++, html, css) but I will try this anyway. It would be more fun to learning a language by making games.
@DaFluffyPotato Жыл бұрын
This tutorial requires that you already know Python. Although I guess if you already know other languages you might be able to pick it up as you go. It'd be difficult.
@vandorlokronika9581 Жыл бұрын
@@DaFluffyPotato Maybe I will watch a very basic summary vide of pyhton before. I try this. After C++ unlikely that is going to be a problem.
@peasantrobot Жыл бұрын
Thank you for this complete course! I will try to reproduce it in C language and raylib...
@oaklemon19205 ай бұрын
Thank you very much sir we needed just this. You are pygame god.
@marverickbin Жыл бұрын
The best part of game dev IMO is these low-level steps, love it. Using game engines kinda bore me.
@yds626810 ай бұрын
This deserves a million views
@breadman7733 Жыл бұрын
Just what I needed in my life. Thanks so much !
@isaiah36135 ай бұрын
23:10 i'm not sure if he did it on purpose but i love this type of dry humor
@Chez19-f2x2 ай бұрын
where was the humor
@isaiah36132 ай бұрын
@@Chez19-f2x in my mind
@j6355 Жыл бұрын
Around 1:12:25 I ran into a problem where I wasn't able to print the tiles from around the player as they were falling, after downloading the code, comparing them side by side, copy and pasting over my own code with yours in some places to determine what was actually different, it turns out I had the "return" function on the wrong indent within tiles_around I would have never caught something like that on my own and could have been very frustrating to troubleshoot without the example code. Now I have another thing to add to my list of things to check if stuff doesn't work as it should and hopefully this problem wont catch me off guard next time. Just saying thank you and posting in case anyone else has a similar issue.
@trumansmith7630 Жыл бұрын
Nice find, my character kept falling through the tiles. Could have sworn I wrote the PhysicsEntity wrong... but nope! Wrong indentation! Don't be like me, check your tabs B^) thanks for commenting
@matiasgarciacasas5583 ай бұрын
This is an incredibly valuable resource
@ragnarok_141 Жыл бұрын
It 's kinda hard to understand but im sure i'll get the hang of it. Nice tutorial Btw :).
@Chrotesque Жыл бұрын
I imagine this is the most random feedback ever but I just came from your video "How to Code (almost) Any Feature" to this and have to say that you improved the way you talk in these videos immensely!
@alexandropoulosk8474 ай бұрын
Impressively rich, enjoyable and well-organized guide. However, code structure and clarity are lacking. I understand this is made on purpose and probably reflects your development practice.However, I think it is greatly important for pedagogical reasons and ease of implementing changes. My only other experience with pygame was from Eric Matthes' Python Crash Course, and I was pleasantly surprised by the number of concepts and useful tips your guide contained. Overall, it offers a creative and satisfying learning experience, so congratulations on making this, and thank you for posting it here for free.
@DarkblooM_IO5 ай бұрын
Super cool video, thanks!
@anantpankaj14602 ай бұрын
at 48:15 i cant understand the precedence of displaying surfaces ,plz help...well now understood