Pygame Platformer Tutorial - Full Course

  Рет қаралды 400,652

DaFluffyPotato

DaFluffyPotato

Күн бұрын

Пікірлер: 622
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
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
@rubendriezen7177 Жыл бұрын
I made my own programming language in python!
@herikgiammaria9961
@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
@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
@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
@AndrewHTR Жыл бұрын
@@herikgiammaria9961 salve herik
@thes_ntry
@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
@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 !
@emperor8716
@emperor8716 Жыл бұрын
this is crazy. a tutorial from the actual best, i can't wait to do this.
@nilusnilus6365
@nilusnilus6365 Жыл бұрын
wow i remember a few years ago following your platformer tutorial, very glad to see you continuing the series :D
@VolarGorilla917
@VolarGorilla917 2 ай бұрын
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 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.
@ZaynBrando
@ZaynBrando Жыл бұрын
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!
@galaxybrainnews9772
@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
@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).
@lucaivaldi4520
@lucaivaldi4520 9 ай бұрын
@@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!
@DarkPlaysThings
@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!
@holon4662
@holon4662 Ай бұрын
This tutorial is amazing. I am about 3 hours into it and my "selfmade" map editor is almost finished. That's the coolest thing I created in Python so far. Thank you so much for the excellent walk through for all the mechanics. It saves me several hours I would need to study and understand the Pygame library from the documentation.
@pistondev2204
@pistondev2204 Ай бұрын
true bro I am also grateful for him that we got these tutorials in youtube easily, imagine people making games in 2000s where these things didn't existed
@danleedev
@danleedev 18 күн бұрын
It is astounding how productive you are, and how excellent your games have become, given the very brute-force nature of your code and how mercilessly you choose to do what works over trying to do it "right". I am profoundly shamed and equally inspired by your work.
@JamieKilduff
@JamieKilduff Жыл бұрын
So happy this was uploaded, couldn't find a better person to explain pygame then this legend, Well done Potato keep killing it
@sricharanathanti3181
@sricharanathanti3181 Жыл бұрын
This guy has to go down in the books as the best Python game developer.
@PeterDinklager
@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
@sc2sperwerfy249
@sc2sperwerfy249 Жыл бұрын
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.9108
@kuba.9108 11 ай бұрын
@@sc2sperwerfy249just normal eventtype K_UP or K_DOWN i belive
@StayInNeverland1
@StayInNeverland1 7 ай бұрын
@@sc2sperwerfy249 K_LEFT and K_RIGHT
@LemmonTea
@LemmonTea 3 ай бұрын
I figured out how to add left and right, it was actually cool to try and figure it out on my own
@SagaContinu
@SagaContinu Жыл бұрын
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
@HammouaI0I0I0
@HammouaI0I0I0 9 ай бұрын
how to do this btw
@SagaContinu
@SagaContinu 9 ай бұрын
@@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.
@HammouaI0I0I0
@HammouaI0I0I0 9 ай бұрын
@@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
@IfYouEscapedYTKidsIWillGetYou
@IfYouEscapedYTKidsIWillGetYou 2 ай бұрын
@@HammouaI0I0I0 by learning pygame and python
@АлексейШтейников-ц4ц
@АлексейШтейников-ц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
@DaFluffyPotato Жыл бұрын
It's only easier to get started learning with Unity. At my level, I can work faster than people using Unity.
@chigstardan7285
@chigstardan7285 Жыл бұрын
@@DaFluffyPotato That's so cool.
@sushismitcher225
@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
@Man-mx2sy Жыл бұрын
nah check out clear code, that dudes fire
@chigstardan7285
@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.
@stephan19912710
@stephan19912710 5 ай бұрын
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
@ZedTheThrid
@ZedTheThrid 5 ай бұрын
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)
@moanzx2
@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! 😊
@fuzzy-02
@fuzzy-02 6 ай бұрын
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!
@RAM-nb1ot
@RAM-nb1ot Жыл бұрын
I was literally following your old pygame tuts and if they werent alr a blessing we got this :) thanks man
@jumparoundtheatoms
@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.
@Nolexes
@Nolexes 9 ай бұрын
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
@daniehexer7016
@daniehexer7016 Жыл бұрын
It's great seeing your tutorials, can't wait to try this myself!
@cursorop1716
@cursorop1716 Жыл бұрын
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 .
@anameanother3557
@anameanother3557 4 ай бұрын
thank you so much
@Programmer-Anchous
@Programmer-Anchous Жыл бұрын
This is the best pygame platformer tutorial I've ever seen! Thank you!
@gibran800
@gibran800 Жыл бұрын
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.
@paranimias
@paranimias 11 ай бұрын
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!
@Plexus37
@Plexus37 4 ай бұрын
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.
@official-phuh
@official-phuh 8 ай бұрын
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).
@carrotsandcats
@carrotsandcats Жыл бұрын
Thank you so much for this, it’s so cool that you « remade » your old tutorial séries and improved it!! Thx
@ekaterinamalinkina3899
@ekaterinamalinkina3899 Жыл бұрын
What a great tutorial! Clear, concise, and not tiring to watch :) feel like i got a lot from this, thanks
@anantpankaj1460
@anantpankaj1460 5 ай бұрын
at 48:15 i cant understand the precedence of displaying surfaces ,plz help...well now understood
@lustrias
@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👍
@wuziq
@wuziq 6 ай бұрын
1:09:47 the double slash does floor division. the floor for negative numbers is more negative.
@joon9360
@joon9360 2 ай бұрын
At 1:50:00, wouldn't using f-strings be faster? Like loc = f"{x};{y}" instead of loc = str(x) + ';' + str(y)
@mike_jay
@mike_jay 11 ай бұрын
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.
@j6355
@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
@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
@EduTechNeer
@EduTechNeer Ай бұрын
To All my fellow learners using MacOS at time stamp 2:37:03 for the level editor I had to use the "z" key for scrolling through the different variant types in a group instead of LSHIFT. Best I can tell is MacOS reserved certain key combos for other functionality and it overrides pygame-ce functions. There may be a more elegant solution but I simply used the "z" button which is right next to the shift key. I love my Macbook Pro but the more I get into this the more I see developing on MacOS kind of sucks. I am a total noob at this but now I understand why some things may only be developed for one or the other because of all of these little items like key combos.
@DerpyDungeoneer
@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.
@curiousstudent7961
@curiousstudent7961 Жыл бұрын
my coding got so much cleaner from using this as a guideline, thanks!
@renatozr11
@renatozr11 Жыл бұрын
This comment is the equivalent to 1 million likes, at least for my heart.
@FrankieDev
@FrankieDev 11 ай бұрын
each like on this is another million so you have provided 63 million likes so far now
@LawrenceAaronLuther
@LawrenceAaronLuther 10 ай бұрын
You said it. What a wonderful gift this video is
@goodlookinouthomie1757
@goodlookinouthomie1757 9 ай бұрын
Well I'm not writing a sonnet about it but I agree is was an awesome tutorial.
@agentnull5242
@agentnull5242 9 ай бұрын
100 million likes.
@MrBIizzard
@MrBIizzard 7 ай бұрын
Corny
@thisisnotkj
@thisisnotkj Жыл бұрын
thank you for the great tutorial :D, will be watching it over the coming days!
@friesguy5467
@friesguy5467 7 ай бұрын
2:21:20 for me, this doesn't run even when I use the sample project. I get an error in the entities.render() method. surf.blit(pygame.transform.flip(self.animation.img(), self.flip, False), self.pos[0] - offset[0] + self.anim_offset[0], self.pos[1] - offset[1] + self.anim_offset[1]) TypeError: invalid destination position for blit Not sure what's going on there... I see it now. I need parentheses around the destination parameters.
@musaplusplus
@musaplusplus Жыл бұрын
God damn Fluffy , you really went in with this one
@willwillcode7568
@willwillcode7568 Жыл бұрын
Finally, a good tutorial on pygame! Thanks so much
@tas47
@tas47 7 ай бұрын
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.
@DaFluffyPotato
@DaFluffyPotato 7 ай бұрын
The full physics video I referenced has that.
@tas47
@tas47 7 ай бұрын
@@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.
@joshbarros1995
@joshbarros1995 Жыл бұрын
Oh my god!!! its soooo perfect!!! I'll take this tutorial this Saturday!!!
@prafultimbadiya9891
@prafultimbadiya9891 Жыл бұрын
Your graphics are AMAZING!! ❤❤
@TheLimbones
@TheLimbones 10 ай бұрын
2:41:55 rock and stone
@sourcream1671
@sourcream1671 Жыл бұрын
This is amazing, brilliant work!
@arbitervildred8999
@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)
@khushankgalgat
@khushankgalgat Жыл бұрын
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!
@bini420
@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"
@yasmaster20
@yasmaster20 26 күн бұрын
4:26:10 'well now it can move ... lets give it a gun!'
@RickyRunyan-y1b
@RickyRunyan-y1b Ай бұрын
Haven't finished the thing yet but any one that will give 5+ hours of their time is doing such great things for other people. It's amazing that a person can get this free by watching some ads. That's a great deal, honestly. Don't hate ads. It's a great system.
@NathanGentala
@NathanGentala Ай бұрын
Hi. I am having an error: Tilemap.__init__() got multiple values for argument 'tile_size' and I think it was to do with the face that my tiles are not the same size as yours? My code is the same. I used asperite to create all my tiles and player models in a 32 x 32 bit box. Is this okay? Would I switch tile_size = 16 to tile_size = 32? I cant find documentation because the tilemap is not something native to pygame.
@TheseWordsTouch
@TheseWordsTouch 2 ай бұрын
Mine breaks around 1:03:21 with the following error: "surf.blit(self.game.assets[tile['type']][tile['variant']], (tile['pos'][0] * self.tile_size, tile['pos'][1] * self.tile_size)) IndexError: list index out of range" I made sure there were no typos in the keys that it references, but the error persists.
@SpaceJETs
@SpaceJETs Ай бұрын
at 2:31:46 I was getting a file loading error from the utils for some reason. It was saying that the load_images(path) files in the assets dictionary were not there. So i just replaced the BASE_IMG_PATH variable in utils to an absolute path since everything is in the same folder anyways. It works, but I would like to know why it was not working with the path from content root. Because the data folder was in my project.
@q1chen
@q1chen Жыл бұрын
It took me several days to finish it and i really learned a lot, thanks!
@Rizzstech
@Rizzstech Жыл бұрын
great tutorial, really need help tho, at 1:13:01 my sprite does collide but it goes into the ground block and stops there rather than falling or being op top of block
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
Sounds like an incorrectly placed or sized rect. Compare with the reference code to see where you made a mistake.
@Rizzstech
@Rizzstech Жыл бұрын
i checked but still can't find the mistake, is there a discord or a way to ask community (people deactivated my stackoverflow question and even tho its out for review it hasnt been checked)@@DaFluffyPotato
@LukaGantar
@LukaGantar Жыл бұрын
Thanks a lot for this, the tutorial is a great, comprehensive intro to pygame!
@Rafaeldonfigueiredo
@Rafaeldonfigueiredo Жыл бұрын
It's another great tutorial, Fluffy. Thank you
@parzival5884
@parzival5884 6 ай бұрын
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!
@stepforward582
@stepforward582 Жыл бұрын
26:55 QWERTZ also doesn't really have zxc close to each other
@sleepless2132
@sleepless2132 8 ай бұрын
48:18 I'm getting module object is not callable not sure what I've done wrong. not sure if I'll get an answer but thought I'd ask before I go to bed to refresh my mind.
@DaFluffyPotato
@DaFluffyPotato 8 ай бұрын
Compare with reference code
@AsifWest-wp5ke
@AsifWest-wp5ke Жыл бұрын
If i wanna run this game in my mobile phone how can i? am i gonna have to re adjust the frame size and responsiveness of the game to run on diffren size?
@ledinhthai69
@ledinhthai69 11 күн бұрын
self.velocity[1] = min(5, self.velocity[1] + 0.1) VScode says that it is wrong with 0.1 because it is float but the function requires the integer.
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
How is 'offset[0]// self.tile_size' the top left of the screen i don't get it at 1:48:17 thx :)
@vandanasinha3262
@vandanasinha3262 5 ай бұрын
I had the same question
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
I was also having trouble wthe bottom right as well 😅😅😅
@DaFluffyPotato
@DaFluffyPotato 5 ай бұрын
The camera offset (passed as offset there) is the top left corner of the "view" in the world's pixel coordinates. You perform an integer division by the tile size to get from pixels to tile coordinates so you can look up tiles based on the camera position.
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
Thank you so much for the explanation :D
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
i didn't understand how the camera was working I think that was the problem i was having
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
Great video btw thank you so much and also answering my question !
@javierrenteria3195
@javierrenteria3195 Ай бұрын
great tutorial.. what i was looking for.. question.. what vsc plugin do you use to see pygame doc for example when you hover a pygame method/service? thanks in advance :D
@5StarKlix
@5StarKlix 5 ай бұрын
16:21 how do u do that where you move all the lines at once so they can be indented
@trumansmith7630
@trumansmith7630 Жыл бұрын
Thank you so much for sharing this tutorial! I have a question though, at 1:51:00 during tile optimization, I'm getting a TypeError on line 37, within the definition of the render function. 'float' object cannot be interpreted as an integer. Would installing numpy and using arange() be a solution? I compared my code with the repository, maybe I'm missing something...
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
Just wrap the parameters with int(). I think the // operator has varying behaviours depending on the system/version.
@trumansmith7630
@trumansmith7630 Жыл бұрын
@@DaFluffyPotato That worked, thank you!
@MainakShaw_
@MainakShaw_ 11 ай бұрын
I hope it's okay to ask for such an old video - 1:34:28 is where you talk about the scroll/camera placement related math for both the x-axis and y-axis coordinates. Some elaboration on that would be nice. Couldn't figure out how that actually worked.
@aidanmorgan6396
@aidanmorgan6396 10 ай бұрын
it was very confusing for me as well, I spent a while just staring at the code and doing the math for different situations myself until it made sense
@justin7oo994
@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
@Jioarg
@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.
@CodeTitan65
@CodeTitan65 Жыл бұрын
Guys i cant find the assets , i went to d fluffy potato website but the website's down , some one pls share me assests i want to learn this so bad
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
Fixed. My VPS provider migrated the server for an emergency while I was on vacation and shut down all processes.
@CodeTitan65
@CodeTitan65 Жыл бұрын
@@DaFluffyPotato Thanks, i was able to download the assets and i'm half an hour into this tutorial, thanks for making this a free course
@joshuarose20
@joshuarose20 Жыл бұрын
*HOW IS THIS FREE*
@wkol1120
@wkol1120 9 ай бұрын
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~~~
@mojojojo123
@mojojojo123 Жыл бұрын
Thank you for sharing!!! This is such a great tutorial :)
@isaiah3613
@isaiah3613 7 ай бұрын
23:10 i'm not sure if he did it on purpose but i love this type of dry humor
@Chez19-f2x
@Chez19-f2x 5 ай бұрын
where was the humor
@isaiah3613
@isaiah3613 5 ай бұрын
@@Chez19-f2x in my mind
@juicy3397
@juicy3397 5 ай бұрын
Hi , I didn't understand at 1:16:13 , why u you do a * on the pos , even u said its for make it pixel .. I really dont get it
@breadman7733
@breadman7733 Жыл бұрын
Just what I needed in my life. Thanks so much !
@moisesdepaulodias7980
@moisesdepaulodias7980 Жыл бұрын
Hi there, I have a question, I was testing the code from the part "02_images_input_collisions.zip", but I noticed that, even with one image and some rectangles (btw, i used the .convert() in the image) the FPS is kinda weird, like, the movement of the cloud is not smooth. if i take the cloud to the upper part and hold the down arrow, i can see some stutter, like if some frames was being skipped. I can also see that in your video. I dont know if i was clear enough. I tried to debug and i added a start_time = time.time() right after the while True and added a print(time.time() - start_time) right after the self.clock.tick(60), the expected result should be close to 0.01666, but sometimes it was printing 0.019, 0.020. Is this expected? I can see some of these stutters when you show your partial results, i dont know if this is intrinsec to pygame.
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
clock.tick() isn't perfect. It will always take slightly longer than it's supposed to and cause some jitter because of the display refresh rate. Typically it's better to use delta time and uncapped framerates, which I have another tutorial on.
@supermuffinbros4797
@supermuffinbros4797 Жыл бұрын
AZERTY has Z and W swapped so Z and X are unfortunately not close to one another... I hope what Godot does with its "physical keys" will catch on. Not that pressing Alt-Shift to change keyboard layouts is hard, but it would be nice regardless.
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
I'm pretty sure I said X and C, not X and Z. I can't find where in the video I talked about that to double check though.
@v공칠이칠
@v공칠이칠 Жыл бұрын
The character and tile are 64 pixels, so I changed the tile_size to 64, and the character does not collide with the tile How do I fix it? 1:27:20
@Boss-PW
@Boss-PW 10 ай бұрын
me it says import "pygame" could not be resolved?
@Boss-PW
@Boss-PW 10 ай бұрын
help
@DaFluffyPotato
@DaFluffyPotato 10 ай бұрын
You don't have Pygame installed.
@Spark_Init
@Spark_Init Жыл бұрын
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🙂
@AbdulrahmanAl-ghzali
@AbdulrahmanAl-ghzali 5 ай бұрын
I really need help, what font do you use?
@chaitanyasannidhi9982
@chaitanyasannidhi9982 6 ай бұрын
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.
@brianbrooks4448
@brianbrooks4448 7 ай бұрын
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
@LemmonTea 3 ай бұрын
Yeah, me neither
@dagmawiabey8358
@dagmawiabey8358 Жыл бұрын
i have a few questions, i hear people and most of the internet say that python is very slow compared to programming languages like c++, so is there any disadvantage that i would get from making 2d and 3d games with python? thanks!
@yannickblum5348
@yannickblum5348 Жыл бұрын
Awesome stuff, thanks a lot. I seem to have some inconsistency when dashing and killing enemies. Enemies sometimes don't die even though they should (I am well within distance where the if statement if abs(self.game.player.dashing >= 50): should be True, also no sparks), not sure where this could originate from, any ideas?
@DaFluffyPotato
@DaFluffyPotato Жыл бұрын
Test the reference code to see if the issue persists.
@edgarvas2108
@edgarvas2108 Жыл бұрын
could you explain to me the neighbor offset list at 1:07:15 ? I didn't really understand it
@andreapasquinelli2874
@andreapasquinelli2874 Жыл бұрын
Are you using VS Code as your IDE?
@mobs9306
@mobs9306 11 ай бұрын
Following this series with Zig and Raylib pretty similar experience except a lot of low level concerns.
@juicy3397
@juicy3397 5 ай бұрын
What if , for the Camera , we move the surface and not all individualy?
@未来の天才侍Tensai
@未来の天才侍Tensai 3 ай бұрын
When im using the blit function to display an cloud it just displays a black screen any fixes please
@isaiah3613
@isaiah3613 7 ай бұрын
4:13:20 Placing the spawners on top of decorations like trees and boxes might cause a crash. I thought i would leave a comment in case someone was struggling with that
@willfowler5361
@willfowler5361 7 ай бұрын
I get a runtime error at this point even if I place the spawner in mid air. Not really sure why though. The error states that the dictionary changed size during iteration while extracting locations in the tilemap. Do you have any idea how I would be able to fix that? I pretty much followed the video line by line stopping to mess around with numbers and such, and as soon as I started adding spawners into the level editor I can't get the game to actually run at all.
@willfowler5361
@willfowler5361 7 ай бұрын
Disregard I figured it out. Super dumb, but I got it all sorted out.
@asterix...
@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
@DaFluffyPotato Жыл бұрын
I started with Python and picked up Python shortly after in 2013.
@asterix...
@asterix... Жыл бұрын
@@DaFluffyPotato Dang, super impressive projects dude
@maikelvangrootel3843
@maikelvangrootel3843 11 ай бұрын
Could someone help me with the following: When running after the 2:40:00 mark the tiles that are being placed are transparent instead of full? When I change the alpha of the current_tile_img the placed tiles are not transparent anymore. How can it be that this is not the case in the video.
@itsvar8
@itsvar8 4 ай бұрын
copy is missing here --> current_tile_img = self.assets[self.tile_list[self.tile_group]][self.tile_variant].copy()
@Sfdc123
@Sfdc123 8 ай бұрын
There is also a pygame snippets extention in vs code for anybody who wants intellisense
Pygame's Performance - What You Need to Know
9:11
DaFluffyPotato
Рет қаралды 212 М.
I made Games with Python for 10 Years...
28:52
DaFluffyPotato
Рет қаралды 392 М.
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН
번쩍번쩍 거리는 입
0:32
승비니 Seungbini
Рет қаралды 182 МЛН
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
God-Tier Developer Roadmap
16:42
Fireship
Рет қаралды 7 МЛН
I Trained an AI for 2 Years on Trackmania. It's Breaking Records.
27:50
Making a Game in Python with Some Experience
5:08
Crepe
Рет қаралды 2,3 М.
Is 8-Bit Minecraft Possible?
12:58
Inkbox
Рет қаралды 1,4 МЛН
A Programmer's Guide to Pixel Art
9:28
DaFluffyPotato
Рет қаралды 200 М.
I Made a 32-bit Computer Inside Terraria
15:26
From Scratch
Рет қаралды 4,2 МЛН
Can I Use Exploits To Beat Speedrunners? - Learn To Fly 2 IS PERFECTLY BALANCED
11:38
Reacting to Controversial Opinions of Software Engineers
9:18
Fireship
Рет қаралды 2,2 МЛН
3 Hours vs. 3 Years of Blender
17:44
Isto Inc.
Рет қаралды 7 МЛН
Air Sigma Girl #sigma
0:32
Jin and Hattie
Рет қаралды 45 МЛН