Creating an amazing 2D platformer in Python [ SNES inspired ]

Did you play too much SNES as a kid? Have you been raised by Nintendo and Mario? Time to remake the most famous game of that generation! For this beginners tutorial we will use pygame to create a Mario style platformer game that includes an overworld as well.
Thanks to Brilliant for the support, you can find them here: brilliant.org/ClearCode/
Find/support me on other channels
Patreon - / clearcode
Twitter - / clear_coder
Discord - / discord
Timestamps
00:00:00 - Intro & Sponsor
00:02:29 - Level setup
00:39:04 - Collisions
01:02:13 - Floor & Wall jumps
01:36:54 - Platforms
02:03:40 - Semi-collidable platforms
02:40:15 - Level graphics setup
03:09:47 - Player graphics
03:29:08 - Moving objects
04:17:24 - Enemies
05:08:02 - Interactivity & UI
06:14:06 - Sky & background tiles
07:19:53 - Overworld setup
07:57:14 - Overworld movement
09:17:17 - Sound
Related videos
Ultimate introduction to pygame: • The ultimate introduct...
Collisions: • Collisions between mov...
Timers: • Creating timers in pygame
Efficient imports: • Efficient imports in p...
Masks: • Understanding Pygame m...
Tiled: • A guide to level creat...
Delta time: • Understanding framerat...
Cameras: • Cameras in Pygame
Debugging: • Debugging in Pygame
Project files
github.com/clear-code-project...

Пікірлер: 263

  • @ClearCode
    @ClearCode3 ай бұрын

    At the end of the level graphics around 20 minutes got accidentally cut off (just before 03:09:47 ), you can find that part here: kzread.info/dash/bejne/lpxnyJlppMKXfNI.html Sorry for the inconvenience :(

  • @berento

    @berento

    3 ай бұрын

    I have no idea about python ..... will it be ok for me to follow this tutorial ? or should i learn python first ?

  • @CodeKokeshi

    @CodeKokeshi

    3 ай бұрын

    ​​@@berentoi've been following the tutorial while using Unity and C# instead . I'm trying to recreate the logic and it's a good challenge.

  • @berento

    @berento

    3 ай бұрын

    @@CodeKokeshi will it be possible to learn python and this tutorial side by side ?

  • @CodeKokeshi

    @CodeKokeshi

    3 ай бұрын

    @@berento I am certainly sure that only a part of it. I'm a python programmer, I made several telegram bots with it but they don't use the same syntax even if they're the same programming language. So, you'll only learn part of python programming from this tutorial.

  • @triggeredman1222

    @triggeredman1222

    3 ай бұрын

    @@berento No!! to follow up the above tutorial , you must have a good understanding of python list, dictionaries , tuples etc , also function definition and declaration, classes and objects , inheritance etc are must prerequisite.

  • @johnb6714
    @johnb67143 ай бұрын

    I'm glad you are back! Definitely appreciation your work! Very high quality

  • @ClearCode

    @ClearCode

    3 ай бұрын

    thank you so much! :)

  • @von.changfeng
    @von.changfeng3 ай бұрын

    we've waited for over a half a year for this, glad you're back

  • @maniagames94

    @maniagames94

    3 ай бұрын

    YEAH DUDE !!!

  • @suhasjaladi5098
    @suhasjaladi50983 ай бұрын

    Love your content... Good to see you back

  • @novialriptide
    @novialriptide3 ай бұрын

    I appreciate the tutorial using pygame-ce :)

  • @beemarron3642
    @beemarron36423 ай бұрын

    So glad you're back! This looks brilliant!

  • @raoul2683
    @raoul26833 ай бұрын

    This is amazing man. Thank you for putting out quality like this, the premise of the game is exactly what I was looking for

  • @AGI-MachineLearning
    @AGI-MachineLearning3 ай бұрын

    Thank you so much for creating this comprehensive pygame Python tutorial. I haven’t gone through it all yet but I think it’s the most detailed pygame tutorial I have seen.

  • @user-gz5bs6qf7o
    @user-gz5bs6qf7o3 ай бұрын

    So glad you're back! I love all your inspirative contents :3

  • @jvsonyt
    @jvsonyt3 ай бұрын

    I JUST finished space invader's one yesterday. I'm so pumped to wake up today and see what I get to learn next!

  • @gibran800
    @gibran8003 ай бұрын

    You're amazing! Appreciate all the effort you put in your content

  • @anomalouschaz
    @anomalouschaz3 ай бұрын

    thank you so much for the high quality content! I have learned so much thanks to you! I really can't wait to make me some time to go over through this :D I love your work!

  • @soupnoodles
    @soupnoodles3 ай бұрын

    Genuinely good content, keep it up!

  • @MrMorgan-xq4qf
    @MrMorgan-xq4qf3 ай бұрын

    Thank you for the course!! Appreciate people like you giving out such good quality courses for free God bless you

  • @alisher.m
    @alisher.m3 ай бұрын

    Your content is top notch, please release more material!

  • @nivoriumgold4396
    @nivoriumgold439612 күн бұрын

    Man you're just awesome, keep going like this please🎉

  • @daineminton9687
    @daineminton96873 ай бұрын

    fantastic!! thank you for all the hard work

  • @ali-r8263
    @ali-r8263Ай бұрын

    Appreciate your tutorials!

  • @user-gz5bs6qf7o
    @user-gz5bs6qf7o3 ай бұрын

    Finally! I've done. Thank you very much , I hope that you'll success on your own ♥

  • @np8038
    @np80383 ай бұрын

    Very happy that you continue to make content for Pygame!

  • @The_12_Year_Old_Developer
    @The_12_Year_Old_Developer3 ай бұрын

    You were one of my first ever game developer tutorials teacher I ever had. I loved the ursina Minecraft game tutorial, but I honestly was just copying what you did. After I tried the Godot engine, I finally understood that the problem was I didn't understand a word. I followed lots of tutorials, yours, coco code, coding with Russ, I finally learned and fell in love with it. I always wanted to make a game like this, but I still am not experienced enough. Do you think you could recreate this but in Godot please? I love the way you explain and I feel you would be a great Godot instructor. Please clear code, your follower is waiting for you :) -The 12 Year old Game Developer

  • @chigstardan7285

    @chigstardan7285

    3 ай бұрын

    Hi gdscript is very similar to python. If you watched his ultimate introduction to Godot tutorial, you can copy some of the logic used in the game. The advantage with using Godot is that you write less code. Just watch the video, Google how to do that in Godot and trust me you will learn a lot better.

  • @Jhonatha.S
    @Jhonatha.S3 ай бұрын

    please continue with the videos, they are incredible, I'm from Brazil and I study through your channel

  • @DigitalCanineGamesStuff
    @DigitalCanineGamesStuff3 ай бұрын

    Awesome 9 hr course, I still remember working on this exact project over a ago using your older platformer tutorial, I don't use pygame anymore but your videos have been really fun to watch, and have taught me a lot of things, I've also noticed that you released a complete free course on Godot, out of curiousity do you plan on making Godot and Pygame related tutorials or just focusing on one of them?

  • @saisavit2926
    @saisavit29263 ай бұрын

    More than glad you're back

  • @subarunatsuki1902
    @subarunatsuki19023 ай бұрын

    You are a inspiration to all of us ❤

  • @NoaTugy
    @NoaTugy3 ай бұрын

    I can't believe you make this great and educational content for free

  • @Tstar-vf5tc
    @Tstar-vf5tc3 ай бұрын

    I've been following along with your Zelda pygame tutorial for inspiration with a game I'm making. I love your videos, they're easy to follow and extremely helpful. I'd love to see you make a turn based RPG in pygame, where you traverse the map just like in your Zelda video, but upon making contact with the enemy, instead if taking damage, it starts a turn based battle. Anyway, keep up the good work, you're the best.👍

  • @ClearCode

    @ClearCode

    3 ай бұрын

    Working on that, will be out in early March!

  • @Tstar-vf5tc

    @Tstar-vf5tc

    3 ай бұрын

    @@ClearCode sounds great😁 can't wait

  • @grindlord064
    @grindlord0643 ай бұрын

    The lord has returned with another banger!

  • @heatrider
    @heatrider3 ай бұрын

    Thank you for this.

  • @shahzaibhassan2777
    @shahzaibhassan27773 ай бұрын

    Here since you had like 4k subs man, Keep up the work. Thank god i learnt godot before the unity disaster.

  • @dash2154
    @dash21543 ай бұрын

    I have been anxiously waiting for what felt like forever. Thank you sir for your hard work. Just a suggestion; if you get the chance, please make something about web-dev with python

  • @muhammadmz8791
    @muhammadmz87912 ай бұрын

    Thank you. You had a course about sprite classes in your channel, I couldn't find that

  • @mohammadmotaz6419
    @mohammadmotaz64193 ай бұрын

    استمر في الابداع انت شخص جيد Keep creating, you are a good person

  • @TasteDaRDX
    @TasteDaRDX3 ай бұрын

    Hello Chris, thanks for sharing such a great tutorial. I have learned a lot of great techniques, and the material continues to improve. I have watched your videos from the first one. Also your teaching style is excellent and it does make a big difference. While I was following the tutorial, I tried two different techniques and they worked very well with no game impact, just perhaps a simpler approach with less code, so I would like to share with you and everyone here: 1. When working on the collision detection of the Shell with the player, I used the same rectangle idea from Tooth, like this: def state_management(self): # player_pos, shell_pos = vector(self.player.hitbox_rect.center), vector(self.rect.center) # player_near = shell_pos.distance_to(player_pos) # player_front = shell_pos.x 0 else shell_pos.x > player_pos.x # player_level = abs(shell_pos.y - player_pos.y) front_rect = pygame.FRect(self.rect.center, (500*self.bullet_direction, 2)) if front_rect.colliderect(self.player.rect) and not self.shoot_timer.active: # if player_near and player_front and player_level and not self.shoot_timer.active: self.state = 'fire' self.frame_index = 0 self.shoot_timer.activate() 2. For the Spike rotation I used a vector2 instead of trigonometry. In the __init__ here is the change: # rotation using a vector self.loc = vector(0, 0) super().__init__((self.loc), surf, groups, z) # trigonometry # y = self.center[1] + sin(radians(self.angle)) * self.radius # x = self.center[0] + cos(radians(self.angle)) * self.radius # super().__init__((x,y), surf, groups, z) In the update, here is the change: # y = self.center[1] + sin(radians(self.angle)) * self.radius # x = self.center[0] + cos(radians(self.angle)) * self.radius # self.rect.center = (x,y) # rotation using a vector self.loc = self.center + vector(self.radius, 0).rotate(self.angle) self.rect.center = (self.loc)

  • @RossiGiova
    @RossiGiova3 ай бұрын

    Thanks to you I learned to develop video games in pygame, you are very good as a teacher. maybe one day I will publish some tutorials on pygame in Italian the way you do it

  • @Nikos_rebetis
    @Nikos_rebetis3 ай бұрын

    Thx for the tutoriel.

  • @saminhi3025
    @saminhi30252 ай бұрын

    Loved following this video! Along with the Udemy course and many of the youtube tutorials, I have finally got the confidence to make games myself! Thank you so much, i enjoy all your content and advice :) Could you please make a Pokemon style game next? That would be amazing!

  • @grayliar147
    @grayliar1473 ай бұрын

    Thank you for this lecture

  • @carlosrivera5155
    @carlosrivera51557 күн бұрын

    unbelievable, amazing.

  • @binkrassdufass
    @binkrassdufass3 ай бұрын

    Great Video!

  • @ItsBlazeMC69
    @ItsBlazeMC693 ай бұрын

    LET'S GOOOOOOO! THE MASTER RETURNED!! WE'VE ALL BEEN WAITING FOR YOU MASTER FOR OVER HALF AN YEAR!! THIS IS CELEBRATE WORTHY! 🥳🎉

  • @random40s
    @random40s3 ай бұрын

    Woooo! More awesome game tutorials! 👍 👍

  • @CodeX-xyxy
    @CodeX-xyxy24 күн бұрын

    I just wanted to watch pygame tutorial but i got the best explanation of trigonometry

  • @user-hr7xc2zs5q
    @user-hr7xc2zs5q2 ай бұрын

    Thanks for working on that

  • @Querosertraderivoneysilva
    @Querosertraderivoneysilva3 ай бұрын

    Sensacional!!!! Meus parabéns amigo!!!👏👏👏👏👏👏😎👍

  • @Gogei
    @Gogei3 ай бұрын

    Thank you so much ❤

  • @Maverick_iss
    @Maverick_iss3 ай бұрын

    Hello! I love your tutorials, thanks a lot. And i would be very happy if you make a full kivy course like tkinter :)

  • @bepositive271
    @bepositive2713 ай бұрын

    Finallt you uploaded!!

  • @serhiiivanskoi2253
    @serhiiivanskoi22532 ай бұрын

    Hello @ClearCode. First of all I would like to say you a huge thank you very very very much for your tutorials. Would you please cover creating isometric scenes and isometric maps created in Tiled in you further tutorials. It would be very very interesting topic.

  • @DylanTheSpud
    @DylanTheSpud3 ай бұрын

    Return of the KING!!!

  • @freakxxdev
    @freakxxdev3 ай бұрын

    even though his videos are mainly in python (and now gdscript as well), his videos never fail to help me in my sfml journey really appreciate it :)

  • @ronaldocouves988
    @ronaldocouves9883 ай бұрын

    Leaving a like and commenting so the algorithm can boost up the video ❤

  • @BrandonWilliams-wf6hg
    @BrandonWilliams-wf6hg3 ай бұрын

    Awesome!

  • @rezashir3873
    @rezashir38733 ай бұрын

    thank you

  • @jorgegomes83
    @jorgegomes832 ай бұрын

    Hello! Thank you for this tutorial! I hope some day in the near future you consider making a roguelike. It would be awesome to watch and code along.

  • @ClearCode

    @ClearCode

    2 ай бұрын

    maybe later this year!

  • @jorgegomes83

    @jorgegomes83

    2 ай бұрын

    @@ClearCode I'm glad to read that!

  • @BeRaikwal
    @BeRaikwal3 ай бұрын

    WOW, JUST WOW!

  • @konstante5781
    @konstante57813 ай бұрын

    Great video ! Will you ever make java tutorials ? Because you teach very well and your videos look clean.

  • @dailymemes9460
    @dailymemes94603 ай бұрын

    Just love you

  • @mrdixioner
    @mrdixioner12 күн бұрын

    PyGame is very similar to some features of the Godot game engine, or vice versa :). The only difference is that there is a lot of manual work compared to Godot, although PyGame includes some techniques to make the game easier to create. But... By programming the entire game by hand, I began to understand more about how the game works, how collisions and movements work, how textures are loaded and much, much, much more. Thank you so much for such a wonderful lesson! PS. My player still falls through the platform as it moves down. I looked at your code, but didn’t find any differences (maybe I didn’t look well :) ).

  • @dalta202
    @dalta2023 ай бұрын

    the goat is back

  • @Kislashe
    @Kislashe3 ай бұрын

    Wonderful.

  • @christinatrujillo2952
    @christinatrujillo2952Ай бұрын

    For anyone struggling with the file path or getting the error "no such file or director". I have a Macbook and I use VS code. The file path that has worked for me was 'data/levels/omni.tmx'. Just make sure you don't add the '../' in front. That should fix it!

  • @ClearCode

    @ClearCode

    Ай бұрын

    yes, when you open a project folder in VS code it starts going from the main folder, hence the path needs to be relative to that.

  • @hoteny
    @hoteny3 ай бұрын

    Yooo new video just dropped. I’d love to see you make a (online or LAN) multiplayer game, just to see how to handle synchronization and all…

  • @beemarron3642

    @beemarron3642

    3 ай бұрын

    It's on the cards, I've heard!

  • @hoteny

    @hoteny

    3 ай бұрын

    @@beemarron3642 really? Thanks, that is excellent. May I ask where you heard about that? Patreon or discord?

  • @beemarron3642

    @beemarron3642

    3 ай бұрын

    I'm lucky enough to love this talented creature@@hoteny (He'll HATE me getting mushy in the comments, but I can't help being so proud!)

  • @justice-wjaw4072
    @justice-wjaw40722 ай бұрын

    Hi Clear Code! I was wondering if you could help me with a problem im having? I followed every step in your video but whenever I run the game, the overworld doesnt show up but rather it puts me in the first level but under grass blocks. Any idea what could be wrong?

  • @Scar_Face1
    @Scar_Face13 ай бұрын

    я только вчера посмотрел 1 часть и вот спустя 1 день (1 год), 1 час назад вышло продолжение, спасибо тебе

  • @utubesubscriber1100
    @utubesubscriber11003 ай бұрын

    I’m not sure why this video isn’t doing as well as the rest but just thought I’d show my support. You taught me a lot and I hope you continue to make videos. Would love to see how you make Pokémon in pygames!

  • @utubesubscriber1100

    @utubesubscriber1100

    3 ай бұрын

    Now that I look closely it is probably that the thumbnail is too similar to your previous video!

  • @Nuohis13
    @Nuohis133 ай бұрын

    Awesome tutorial! By the way, if I would like to make the horizontal movement acceleration based - so e.g. when you press Left, it starts slower and then sets to the 'max speed', how would I implement that? (same could be done to deceleration aswell?). I think it would add a nice touch to the smoothness of character movement.

  • @Killer10.10

    @Killer10.10

    Ай бұрын

    i have the same probleme

  • @neofx645
    @neofx6453 ай бұрын

    You cheeky little goat 🐐

  • @kingmumputu8931
    @kingmumputu8931Ай бұрын

    hi brother can you enlighten me there is an error like list index out of range in the class AnimatedSprite(Sprite) thank you very much for the transmission of knowledge

  • @ClearCode

    @ClearCode

    Ай бұрын

    something has gone wrong in the import part and there are no frames inside of the AnimatedSprite, so check that part

  • @kingmumputu8931

    @kingmumputu8931

    Ай бұрын

    Thank brother 🙏

  • @simplesimon2960
    @simplesimon29603 ай бұрын

    I've just started this project from earlier videos on your channel. Was just finished generating the level with the list of strings. Is this a different version of the same project? Or part of it?

  • @ClearCode

    @ClearCode

    3 ай бұрын

    this video is the updated version of the old platformer tutorials, it makes all the old ones obsolete!

  • @simplesimon2960

    @simplesimon2960

    3 ай бұрын

    Thank you!@@ClearCode

  • @Maxiow
    @Maxiow2 ай бұрын

    Is it necessary to program the entire collision system? ( Isn't there anything like in Godot, GameMaker or Phaser where collision are already set for us? )

  • @frazomania

    @frazomania

    2 ай бұрын

    yep, it sucks

  • @olden4954
    @olden49543 ай бұрын

    Thank you!

  • @Caveman835

    @Caveman835

    2 ай бұрын

    I like how Clear Code didn't notice this.

  • @josephalbert.
    @josephalbert.Ай бұрын

    @ClearCode At 1:23:03, I followed exactly the same steps, however when I move (self.collision('vertical')) to the bottom, the code the character does not jump except when it is not colliding with any of the floor, left, right. And when I place it here (orange arrow, it jumps fine but when jumping while colliding with right wall, it sinks downward.: def move(self, dt): self.rect.x += self.direction.x * self.speed * dt self.collision('horizontal') if not self.on_surface['floor'] and any((self.on_surface['left'], self.on_surface['right'])): self.direction.y = 0 self.rect.y += self.gravity/10 * dt else: self.direction.y += self.gravity / 2 * dt self.rect.y += self.direction.y * dt self.direction.y += self.gravity / 2 * dt ▶self.collision('vertical') if self.jump: if self.on_surface['floor']: self.direction.y = -self.jump_height self.jump = False Can you kindly help with that?

  • @josephalbert.

    @josephalbert.

    Ай бұрын

    self.collision('vertical') seems to be the issue, what can I do?

  • @ClearCode

    @ClearCode

    Ай бұрын

    I think that issue happens on a lower framerate; it will be fixed later in the game. Basically, when you jump, move the player up by a single pixel, then things should work fine.

  • @josephalbert.

    @josephalbert.

    Ай бұрын

    @@ClearCode Thank you so much for your reply.

  • @user-qy7wj3ev9d
    @user-qy7wj3ev9d3 ай бұрын

    好久不见😀

  • @PeterRichardsandYoureNot
    @PeterRichardsandYoureNot3 ай бұрын

    Does this one include joystick control AS WELL AS KEYBOARD? That is a major stumbling block on pygame. And is tiled files available as well?

  • @ClearCode

    @ClearCode

    3 ай бұрын

    joystick no but tiles yes. Will cover joysticks/ gamepads on my other channel this month.

  • @msbranin
    @msbraninАй бұрын

    Having a problem trying to import the timer class File is in the code folder with the rest of my project but when I add from timer import Timer I get this error Import "timer" could not be resolved from source

  • @msbranin

    @msbranin

    Ай бұрын

    Cancel that... It turned out to be an issue with how visual studio code opens project folders. I had opened the project folder one level above the code folder so that all the support fodlders were inside the project window. Which really really confusedvs code when I tried to include the timer.py. When I reopened the project for the code folder level everything clicked into place. Just dont have all the support folders inside the project window now which is a bummer.

  • @wazmeister3151
    @wazmeister31512 ай бұрын

    I'm having trouble, everything works perfect until 1hr 22mins. The wall slide, I've checked and kept code correctly and i get a weird result jump wont work properly if at all adding the changes to move module. If I remove the code and test, it works fine. seems to be moving self.collision('vertical') might be causing it? I sometimes get the error direction in x error too. Odd my code is exactly how shown?

  • @wazmeister3151

    @wazmeister3151

    2 ай бұрын

    Have it a bit more response now but still since adding the wall check, jump is very unresponsive at times.....odd

  • @ClearCode

    @ClearCode

    2 ай бұрын

    I think you need to move the player up by a pixel whenever you jump, otherwise the floor detection catches you; I am adding that part later in the tutorial

  • @josephalbert.

    @josephalbert.

    Ай бұрын

    same here, did you fix it?

  • @GCKteamKrispy
    @GCKteamKrispy3 ай бұрын

    Well, now I know what I am going to do on my weekends

  • @dimebagou7219
    @dimebagou7219Ай бұрын

    Hello @ClearCode, I don't understand how you make the pearl collision working as the Shell is in the collision_sprite so the pearl is killed right after its creation. I had to use this trick to make it work : def pearl_collision(self): for sprite in self.collision_sprites: if not isinstance(sprite, Shell): pygame.sprite.spritecollide(sprite, self.pearl_sprites, True) Did I miss something ?

  • @ClearCode

    @ClearCode

    Ай бұрын

    when the pearl is created it gets an offset so that it doesn't collide with the shell

  • @dimebagou7219

    @dimebagou7219

    Ай бұрын

    @@ClearCode Ok it's my bad, I forgot I changed it after I chose to launch it from the mouth :D You are perfect. Thank you.

  • @dimebagou7219

    @dimebagou7219

    Ай бұрын

    So I need to let my fix to make that works.

  • @ClearCode

    @ClearCode

    Ай бұрын

    @@dimebagou7219 no worries, hope it works now!

  • @Dexter101x
    @Dexter101x3 ай бұрын

    Wow, 9 and 1/2 hours!!! Would it be possible to create bit size playlists videos?

  • @nicklansbury3166

    @nicklansbury3166

    3 ай бұрын

    It's split into 15 time-stamped selectable sections which is nearly the same. Hope this helps.

  • @Dexter101x

    @Dexter101x

    3 ай бұрын

    @@nicklansbury3166 Not really, I easily lose track at where I was the last time

  • @NoCleanCode
    @NoCleanCode3 ай бұрын

    👏🏻👏🏻👏🏻👏🏻👏🏻

  • @cocothecomputer
    @cocothecomputer3 ай бұрын

    the best pygame tutor is back. you should do his udemy course if you have not done so already!

  • @Qwerty-gu2je
    @Qwerty-gu2je2 ай бұрын

    Thanks for the code, just wanted to ask, at 13:14 you start writing a line related to pytmx. Is this line nessesary, because if so, is there any way to write it without getting an error?

  • @ClearCode

    @ClearCode

    2 ай бұрын

    what error message do you get?

  • @Qwerty-gu2je

    @Qwerty-gu2je

    2 ай бұрын

    @@ClearCode Hi man, thanks for the reply. This is the exact error: Traceback (most recent call last): File "C:\Users\smkei\Documents\Python Coding - Home\SPW_Main\__init__.py\code_start\Clear code platformer.py", line 35, in game = Game() File "C:\Users\smkei\Documents\Python Coding - Home\SPW_Main\__init__.py\code_start\Clear code platformer.py", line 18, in __init__ self.tmx_maps = {0: load_pygame('../data/levels/omni.tmx')} File "C:\Users\smkei\AppData\Roaming\Python\Python312\site-packages\pytmx\util_pygame.py", line 183, in load_pygame return pytmx.TiledMap(filename, *args, **kwargs) File "C:\Users\smkei\AppData\Roaming\Python\Python312\site-packages\pytmx\pytmx.py", line 549, in __init__ self.parse_xml(ElementTree.parse(self.filename).getroot()) File "C:\Program Files\Python312\Lib\xml\etree\ElementTree.py", line 1203, in parse tree.parse(source, parser) File "C:\Program Files\Python312\Lib\xml\etree\ElementTree.py", line 557, in parse source = open(source, "rb") FileNotFoundError: [Errno 2] No such file or directory: '../data/levels/omni.tmx' Do you know what I can do about it?

  • @ClearCode

    @ClearCode

    2 ай бұрын

    so when you try to import the omni.tmx file something is going wrong in the file path and the code cannot find it. You probably have typos somewhere of the folder names

  • @Qwerty-gu2je

    @Qwerty-gu2je

    2 ай бұрын

    @@ClearCode ok, how do I find the location of the omni.tmx so I can make sure that the folder names are correct

  • @ClearCode

    @ClearCode

    2 ай бұрын

    @@Qwerty-gu2je in the project folder there is a data folder which contains the tmx maps; I talk about the folder setup early on in the video

  • @Andrumen01
    @Andrumen0122 күн бұрын

    The intro music is that of the Ninja Pizza Cats! 😄

  • @ClearCode

    @ClearCode

    22 күн бұрын

    Isn't the series called Samurai Pizza cats? :P

  • @Andrumen01

    @Andrumen01

    22 күн бұрын

    @@ClearCode Yes! That one! 😅😅😅

  • @diandradeeke
    @diandradeekeАй бұрын

    thank you very much for this great tutorial. i dowloaded the code but iI also got this error-message while compiling 'pygame.surface.Surface' object has no attribute 'get_frect'. what can i do to solve my problem? I tried to uninstall my pygame version and to download the latest version but it didnt help.

  • @ClearCode

    @ClearCode

    Ай бұрын

    did you install pygame-ce?

  • @diandradeeke

    @diandradeeke

    Ай бұрын

    that was what i was looking for. Thank you. I guess you said that in this video. i skipped a lot of parts, simply because i already know a lot of things about programming. however, when i start the game i start under water. Nothing i cant fix myself.

  • @Killer10.10
    @Killer10.10Ай бұрын

    I have an problem after creating the small clouds, the helicopter that goes down doesn't work, if i stand on it while it goes down my character fals through it(And i'm not clicking on the down button). I now that the collision doesn't work if it goes down, but i don't find the problem. Can someone help me pls🥺?

  • @patolorde
    @patolorde2 ай бұрын

    Can you do a tutorial on creating a 'idle click game' style

  • @triggeredman1222
    @triggeredman12223 ай бұрын

    do anyone know how can i upload my games written in python online, Although the game is not any comlex, but when i try pygame, it don't load ... maybe i have may folders outside the main working directory. So if i can't upload it what the use of writing game in python 🤔🤔

  • @user-jc6cc9pl9k
    @user-jc6cc9pl9k3 ай бұрын

    ❤❤❤ wow , i wish you make Cuphead game like this

  • @rorkeslayer3925
    @rorkeslayer3925Ай бұрын

    I'm stuck at the beginning and keep getting this error every time I try to run the code: Warning: PyGame seems to be running through X11 on top of wayland, instead of wayland directly Edit: I got the code to run now, but the warning continues to pop up. What does it mean?

  • @nathenzuber4021
    @nathenzuber4021Ай бұрын

    What IDE are you using for this project?

  • @user-oi2nd6ys5b
    @user-oi2nd6ys5b2 ай бұрын

    If i try to execute in the class Player , self.rect = self.image.get_frect , it gives me the following error: attributeError. Pygame.surface.Surface object has no attribute 'get_frect' did you mean get_rect? How can i fix it

  • @ClearCode

    @ClearCode

    2 ай бұрын

    you are using the old version of pygame, just uninstall it in the powershell/terminal and then install pygame-ce (it's the much newer and better version of pygame). I talk about it in the video at 00:05:25

  • @user-oi2nd6ys5b

    @user-oi2nd6ys5b

    2 ай бұрын

    @@ClearCode i uninstalled pygame and installed pygame-ce, but i have another question, what type of interpreter you use on vs code

  • @ClearCode

    @ClearCode

    2 ай бұрын

    I use sublime text to code but I always use the latest Python version (3.12 in the video)

  • @nicklansbury3166
    @nicklansbury31663 ай бұрын

    This is great! I'd love to subscribe, but I already have. subscribe++ 👏

  • @muratmutlu8600
    @muratmutlu86003 ай бұрын

    Hi @ClearCode I have an issue, how can I solve this ? When I drag the pygame window, the character's position changes.

  • @ClearCode

    @ClearCode

    3 ай бұрын

    so when you drag the window delta time becomes very large and that messes up the movement. If you limit how large dt can become (for example via a min function) the problem should go away. Just play around the maximum number

  • @muratmutlu8600

    @muratmutlu8600

    3 ай бұрын

    @@ClearCode dt = self.clock.tick() / 1000 max_dt = 0.1 dt = min(dt, max_dt) It seems like this solution might have worked; is that correct?

  • @ClearCode

    @ClearCode

    3 ай бұрын

    @@muratmutlu8600 yeah, that looks good :)

  • @muratmutlu8600

    @muratmutlu8600

    3 ай бұрын

    @@ClearCode thank you so much, you are the best :)

  • @lukaLondaridze
    @lukaLondaridze3 ай бұрын

    Would it be possible to host this on a website? How would I showcase this game to someone without them needing to download it?

  • @seand7603
    @seand76033 ай бұрын

    oh my. I know what I'm doing this week

  • @freewheelburning8834
    @freewheelburning88343 ай бұрын

    Is our protagonist Lemmy from motorhead by chance?

  • @ClearCode

    @ClearCode

    3 ай бұрын

    Yes!

  • @freewheelburning8834

    @freewheelburning8834

    3 ай бұрын

    @@ClearCode Nice!!

  • @rokkorokko8966
    @rokkorokko89662 ай бұрын

    Hello there! I got a problem with code (around time 3.41.20).. could someone help please: level_frames['saw_chain'].get_height() / 2 (AttributeError: 'list' object has no attribute 'get_height') Also problem with level_frames['saw_chain'] ('list' object has no attribute 'get_frect') I miss something..

  • @ClearCode

    @ClearCode

    2 ай бұрын

    General Kenobi! Your problem is that you are getting a list instead of a rect. Maybe you forgot a for loop somewhere? I would recommend to print level_frames['saw_chain'] to see what objects you get, and then go from there

  • @rokkorokko8966

    @rokkorokko8966

    Ай бұрын

    @@ClearCode just for the history, you will not believe me.. i just duplicated the line with 'saw' and didn't notice that it should be just an image not a folder... # shame on me(

  • @lukaasg3476
    @lukaasg34762 ай бұрын

    Hi, I've tried almost everything, but nothing helped me.. :( I'm in 17:09 and it still gives me this error FileNotFoundError: [Errno 2] No such file or directory: '..\\..\\data\\levels\\omni.tmx' I have a main folder where I have a CODE folder and in it I have .py files, then in the main folder I have data and there I have the rest, exactly as it is in the video (also in your .rar file, which I tried to download and also the same problem) you don't know what it could be? thank you very much :)

  • @ClearCode

    @ClearCode

    2 ай бұрын

    are you using VS code? This one uses a different folder path system unless you specifically open the folder

  • @lukaasg3476

    @lukaasg3476

    2 ай бұрын

    @@ClearCode Yes, I use VS code, I already fixed it :) Thanks alot import os script_dir = os.path.dirname(os.path.abspath(__file__)) tmx_file_path = os.path.join(script_dir, '..', 'data', 'levels', 'omni.tmx') self.tmx_maps = {0: load_pygame(tmx_file_path)} self.current_stage = Level(self.tmx_maps[0])

  • @mmz5637
    @mmz56373 ай бұрын

    i have done what you said to upgrade to pygame-ce but vs code is telling me that " 'pygame' has no attribute 'init' ", so its not working at all and also when doing from pygame.math import Vector2 as vector it says pygame has no attribute "math". pls help i'm really confused why it's bugging like this, they worked just fine with pygame but not now.

  • @ClearCode

    @ClearCode

    3 ай бұрын

    are you getting an error message?

  • @mmz5637

    @mmz5637

    3 ай бұрын

    yea its a syntax error message AttributeError: module 'pygame' has no attribute 'init'. i tried the code by downloading pygame back and it has no issues @@ClearCode

  • @mmz5637

    @mmz5637

    3 ай бұрын

    im sorry its working now i deleted it and re- installed the pygame-ce on vs code terminal seems to have fixed the issue completely thank you for helping@@ClearCode

  • @ClearCode

    @ClearCode

    3 ай бұрын

    glad it's working now :)