I think it should be better if you learned the language first. I talk for experience, doing something without understanding/remembering how to do it by yourself is kind of useless and is going to make you lose lots of hours
It's honestly mind-boggling that we get this kind of content for free and that well put up together. I can't thank you enough for your work and passion to spread your knowledge! Keep it up, you're great
I can't believe what I am seeing. Just a few weeks ago I nearly gave up in frustration for lack of quality pygame tutorials, specifically for a Zelda style RPG. Then I found your channel and I started on your course at Udemy. I said to myself, I only wish he'd do Zelda. AND OMG here we are. Thank you very much, You have a real knack for knowing your audience... And your devotion to teaching has changed my life.
@@Drake00000010 A bit of a delay. I had some life stuff happen so I am just now finishing it up. A fantastic tutorial on par with all of his really great content.
I thought this was a 7 min video at first :D I was not expecting a programming video when I clicked it, but thank you very much for creating this. It must have taken a lot of work and I appreciate it very much.
'I didn't watch the video and it isn't useful to me at all but good for you for making it'. You people don't need to leave a comment wherever you end up.
After a couple weeks, I FINALLY finished this tutorial. I had gone through a pygame textbook that was pretty outdated and this introduced me to so many concepts that the book didn't have. Thanks so much for this amazing tutorial!
This channel is by far the greatest coding channel judging by the deliverance of information, keep up the good stuff! Looking forward for more of your great pygame tutorials!
You're the ultimate GOAT, your videos are incredibly well-organized, making learning a breeze. Plus, you generously provide all this valuable content for FREE! I can't express enough gratitude for the wealth of knowledge you share.
This was a terrific introduction to pygame, the only thing that we forgot to add was a player death mechanic but I'm taking on the challenge on my own and feel well prepared to do so. Thank you so much!
Well, to be fair, he did point it out. Reason he didn't implement it is because it's easier to test your game mechanics if you don't also have to worry about not dying.
i had alot of "importing" errors until i realized i need to (ctrl+s) save each of the modules before running the main module for the updated code to work. great video. i learned quite a bit about pygame. thank you :)
This looks incredible, can't wait to dig into it. Agree with the other comments I'm seeing, this is the *exact* tutorial for PyGame that I've been desiring for a few years now.
For a moment i thought this is just a project made by a team of professionals, the second moment i realized this is a WHOLE tutorial Holy crap this is next level dude!! Keep up the good work!!
@Florian D. True, python and pygame are great to make games as a side project, but professionaly i would never use pygame. Don't get me wrong I love pygame.
As a python enthusiast and huge fan of LoZ/DS games, I'm greatly looking forward to watching this. My first major project a few years ago was creating an old-school text adventure that runs in the CLI, and I created a simple animated dungeon map that can be called from within (using pygame). I've been planning to whip up some sort of 2d adventure game like this next - can't wait to dig in.
Took quite a bit longer than 7.5 hours but successfully completed over a weekend. Thank you so much for this! Looking forward to following along with your other guides
I’m an hour in and I can say this: yes, a lot of this is going over my head right now because I don’t have a good enough grasp of Python classes, but WOW. Your presentation is impeccable… perfect pace, great examples, and the logical flow is really helpful. Incredible resource.
To anyone feeling the same struggle: try watching his other videos in conjunction with this one. Such as the Super Mario video from a year ago and "Creating a platformer in Pygame". If your problem isn't simply understanding Pygame, but programming in general, I suggest practicing with simpler concepts first such as importing libraries, making functions and executables or even simple lists.
This is insanity, i've never seen a tutorial like this.... incredibly impressive. I wish I had this a few years ago, it's not so helpful to me now (especially at this length) but if anyone is a beginner this is great!
I think new coders would also benefit from seeing how you divided each pack into your local files because your file locations are integral to your code, but we download them differently from PixelBoy. So as we code, we sort through a lot of things that you have preorganized. Seeing how you have them organized in each file would be helpful in the setup intro part of your vid.
Trust me guys with just a little messing around their is no problem in coding you guys can’t figure out!! I’ve followed so many tutorials since then made 20+ games and became a pygame master and the main thing I’ve taken away from all this was how to problem solve!! You guys got this!!
Sir, I just wanna tell you that you. have changed my life with software, and I admire your teaching style more that anyone's. Thank you for putting out amazing content and never failing to help us.
Who has the audacity to Dislike videos like these? It's truly insane that you can offer a free informative, educational video and somehow that's a bad thing.
You are so my favourite coder on UA-cam. I cant believe that this is so much better and CHEAPER (free) compared to school coding classes. Keep up the good work!! Suggestion: pls do another tutorial is python ursina??
This is amazing, and I can't believe I haven't subbed yet. I'm going to be modifying this code for an online-rpg style project I'm working on. Thanks so much for the great tutorial!
I was wondering how it was possible for such quality content to only have 500 views, but then I realised that I had caught this video just shortly after it had released.
Been watching this video for weeks (I am taking my sweet time) and will be watching it for longer, and I have to say I have never been more excited for a coding tutorial
I found your channel by chance with this video and in two days I managed to follow you step by step and actually create the game. You can't even imagine how I happy I am right now! Thank you very much man, this project must have been really heavy so really thank you so much for doing it and sharing it here!
Dude, you are just awesome! Very impressive what you build here. Isn´t it awesome that programmers are able to make the inner child live forever this way? :-)
When I started learning Python on my own, I knew the basics but had no idea how to apply what I learned. This project is helping me because many abstract concepts are now solidifying inside my mind. Thank you so, so much for the great content you put out and for your patience, you are an EXCELLENT teacher, really! The effort you put into being thorough in your explanations is greatly appreciated!
Thank you so much for the pygame walkthrough! I blew people away in my intro to python class and I only turned in milestone 1 for my project. Which was having collisions working without any of the camera. I am so grateful for your explanations. Keep it up!!
As a fan of both Zelda and Dark Souls, I was ecstatic to find this tutorial. Clear Code, your ability to teach complex concepts in an easy-to-understand manner is truly impressive. Your dedication to providing high-quality, free educational content for aspiring developers is greatly appreciated. I can't wait to start working on my own Python-based RPG using the skills I've learned from your tutorial. Thank you for your hard work and for sharing your knowledge with the world!
Wow! This is fantastic! This channel and the Coding with Russ channel are right up there with this type of content and tutorials. Thank you so much for this, it is very much appreciated. The time and effort you have put into this, its astounding! :)
Wow, this is next level! There are some points where I'd solve things differently. E.g. the repetitive if statements in order to assign a value to a variable could've been solved more elegantly using dictionary indexing. And adherence to PEP-8. Small stuff like that. But the presentation is on a level worthy of admiration. The way you explain everything as you go, providing sufficient context or explanation so the audience knows at every moment what you're doing and why. How you break the project into pieces and how you tackle them in succession without losing track of the goal. It's obvious a ton of preparation went into this, way in excess of the almost 8 hours of resulting video. And this is just one of many such videos you've put out so far. Thanks for such great tutorials!
The value of what you're giving the world simply can't be overstated, sir. You're an example of the kind of person that spends their time uplifting others and it's a pleasure to learn from you
I'll be honest many times I skipped the announce for the sponsor but I video at this quality can't be rewarded enough, and it's free ! massive thanks to you I've been here for a long time and I am always amazed by the games and logic that you come up with.
What a great tutorial. I have never programmed in python and this most likely will be my first one because it’s awesome! This was also my first SuperThanks$ here on UA-cam. I’ve never seen such amazing work being freely presented. 👏🏻
Excellent tutorial! Would you be interested in making up a tiny follow-up video to show how to code: 1) a game over "state" upon player death 2) a level "reset/retry" option after the player dies 3) how to load a new level upon clearing an "objective"
Integrate his overworld code from the mario platformer tutorial. Beware though, it resets the exp and menu settings every level... not been able to get the ui and upgrades into the game class yet so they stay with the player each level...
@@thatguy-cf5gs Hi. What was your solution eventually? I think I put all player variables I want to persist in a dictionary in the settings file. Alternatively, a method that passes current_exp to a new_exp variable then create level function with the new_exp passed in. I did this with my metroidvania here with the weapons the player has when swapping levels (or rooms in this case) m.ua-cam.com/video/KhVwVFdolJs/v-deo.html
00:03 Creating a Zelda style RPG with sophisticated graphics and mechanics. 02:46 Setting up game variables and world map layout 07:21 Setting up the display and creating the level class 09:31 Sprites can be placed in different groups for interacting with the environment differently. 14:10 Creating a flexible tile class with sprite inheritance 16:28 Setting up graphics and player classes 20:43 Setting up the world map in Python with Dark Souls elements 22:53 Converting world map into positions using row and column indexes. 27:05 Setting up player and basic level setup. 29:01 Adding player direction and keyboard input 33:15 Implementing keyboard input for player movement 35:21 Implementing player movement with speed in Python game 39:25 Separating move method for player and enemies for flexibility 41:19 Implementing player collisions in Python game 45:36 Adjust player positioning to avoid overlapping with obstacles. 47:42 Implementing player movement and collision detection 52:00 Inheriting from pygame.sprite.group for camera functionality and sprite sorting 54:10 Implementing custom draw for sprites 58:07 Implementing game offset and connecting it to the player position. 1:00:19 Implementing camera movement in the game 1:04:31 Moving hitbox to manage collisions and player position 1:06:38 Implement custom hitboxes for player and tiles 1:10:44 Basic top-down game with camera, collisions, and good visuals. 1:12:50 Building the map layer by layer 1:16:51 Adding a surface and rectangle for the floor 1:18:52 Implement offset for drawing floor surface 1:23:04 Adding parameters to title class 1:25:08 Importing and converting CSV files for creating a world map in Python 1:29:27 Creating a separate container for terrain map 1:31:25 Creating style and layout for the game world map. 1:35:47 Correcting coding error and testing game functionality. 1:37:56 Importing grass and object layouts for tile creation in the game. 1:42:03 Loading images in a Zelda style game 1:44:18 Importing and organizing graphics for the game level. 1:48:44 Using ids for indexing images and objects in tiled. 1:50:52 Adjusting placement for larger objects in the game. 1:55:09 Creating player animations for different actions 1:57:10 Implementing attack and magic inputs with key controls 2:01:25 Creating a custom timer for tracking game events 2:03:38 Implementing a cooldown system for attacks and magic. 2:07:57 Creating a full path to import graphics for player states 2:10:16 Setting up state management for player animations. 2:14:25 Implementing player movement directions based on input 2:16:37 Handling player movement and idling in the game. 2:20:50 Replacing idle status with attack status 2:23:00 Implementing player status and animation logic 2:27:09 Setting image and frame index for animation 2:29:21 Implementing player animations and weapons 2:33:35 Positioning the player and weapon correctly 2:35:40 Creating a method to handle player attack functionality. 2:39:45 Using the split method in Python for game development 2:41:44 Positioning weapon relative to player 2:45:57 Adjusting weapon placement and graphics in the game 2:48:03 Implementing weapon selection and image display 2:52:23 Creating a method to despawn weapons 2:54:34 Implementing weapon switching and attack mechanics 2:58:47 Update weapon functionality in Python game 3:01:02 Implementing weapon cooldowns for switching 3:05:13 Creating user interface elements like health bar and energy bar and key player attributes through dictionary. 3:07:12 Creating player stats and starting the UI 3:11:15 Setting up UI elements and colors for the game 3:13:14 Setting up health and energy bars in the game interface 3:17:26 Drawing health and energy bars in Python with required ratios 3:19:27 Calculating pixel width based on health ratio 3:23:39 Implementing the experience system 3:25:44 Placing text surface on bottom right corner of game window 3:29:47 Customizing Rectangles in Pygame 3:31:44 Creating a selection box for weapon background 3:35:50 Implementing weapon index for surface placement 3:37:46 Creating weapon graphics from settings 3:41:57 Changing border colors and weapon selection implementation 3:43:54 Implementing magic abilities and UI in the game 3:47:55 Implementing magic creation in the game 3:49:55 Accessing and using dictionary values for game mechanics 3:54:08 Adding cooldown logic for magic switch 3:56:12 Implementing magic overlay UI 4:00:26 Implementing shared methods for player and monsters. 4:02:23 Explaining attributes and mechanics of enemy characters 4:06:36 Setting up the basic attributes for enemies. 4:08:46 Setting up monster names and positions 4:12:43 Creating player based on tile set IDs 4:14:46 Implementing enemy class for basic sprite creation 4:18:50 Creating individual enemy paths and importing graphics 4:20:55 Setting monster animation based on status 4:25:19 Implementing enemy movement and hitbox in the game. 4:27:25 Implementing enemy movement and stats 4:31:34 Implementing enemy movement based on player distance and direction 4:33:44 Understanding vector relations and converting to distance 4:37:48 Handling player-enemy collision 4:39:50 Implementing enemy updates and filtering enemy sprites 4:43:56 Implementing player status and movement logic 4:46:08 Animating enemies with similar steps as the player 4:50:16 Managing enemy attack behavior 4:52:21 Creating a timer for enemy attack cooldown. 4:56:53 Implementing player-enemy interaction logic 4:58:41 Creating groups for attackable sprites 5:02:39 Implementing collision detection and sprite destruction in the game. 5:04:42 Implementing sprite destruction and damage calculation in Python game. 5:08:34 Calculating total damage from base and weapon damage 5:14:52 Implementing enemy hit mechanics 5:17:03 Implementing hit reactions for enemies in the game 5:21:24 Implementing a function to toggle between 0 and 255 using a sine wave in Python 5:23:31 Implementing flicker effect for the player character 5:27:38 Implementing enemy damage functionality 5:29:48 Implementing vulnerability and invulnerability mechanics. 5:34:06 Creating a new particle effect in Python 5:36:17 Implementing animation control in the game 5:40:32 Implementing particle effects using animation player 5:42:39 Creating particle effects with random animations 5:47:05 Adjusting particle effects and generating enemy particles 5:49:23 Creating a function for playing particles during player attacks 5:53:53 Creating trigger death particles for enemy animations. 5:56:09 Implementing magic spells in the game 6:00:06 Setting up parameters for the heal spell 6:02:00 Managing player health and energy in the game. 6:06:07 Implementing energy recovery method for player 6:08:20 Adjusting player attributes and magic recovery in game development. 6:12:31 Creating directional vectors for movement in the game 6:14:32 Implementing proper for loop and splitting the math into horizontal and vertical directions 6:18:56 Implementing random offset for flames in game 6:21:01 Implementing flame spell functionality 6:25:06 Implementing magic and upgrade mechanics in the game 6:27:11 Implementing an experience (XP) mechanic 6:31:45 Implementing player stat increase and menu functionality 6:34:02 Creating an upgrade menu for the game 6:38:20 Implementing mechanics for left and right movement 6:40:23 Implementing player stats, keys, font, and selection system 6:44:52 Implementing selection index and optimizing UI for game window 6:46:53 Creating item dimensions for Zelda game elements 6:51:00 Setting up window dimensions and element positioning 6:52:50 Creating left side elements and offsetting elements to the left 6:57:02 Displaying item attributes and names 6:59:06 Implementing getter methods for values and cost by index 7:03:21 Implementing title and cost display on surfaces 7:05:38 Implementing cost display and item selection highlighting 7:10:01 Implementing item selection visuals 7:12:01 Implementing a progress bar for player's skill level 7:15:59 Calculating relative number for health bar 7:17:58 Implementing a trigger method to upgrade attributes in the game 7:22:24 Implementing player upgrades and attribute checks 7:24:31 Fix visual issues and add water background 7:28:25 Enhancing movement and sound effects for the game 7:30:29 Adding sound effects to the game elements 7:35:16 Implementing attack sounds for different enemies 7:37:34 Adjusting sound volume and effects for better gameplay experience.
I am glad to see there are always talents people like you who willing to produce such quality and FREE courses for all, this is meaningful, splendid, and much appreciated! Please produce more quality courses, for the whole industry and humanity.
This was such an amazing project! I really wanted to start making adventurous games such as Pokémon and I have to say this tutorial covers already so much amazing what you did! You are amazing!
I am only 10 minutes in and I am loving it. Not only he is explaining it but we are also getting challenges as the opportunity to do some learning by ourselves.
Hey there! Just finished this tutorial among other you have uploaded. Just off to say you make really good resources for people to learn new things. Keep it up and THANK YOU.
This is absolutely amazing. Instantly subscribed. I’ve always wanted to create a game like this style using Python, this is great! Thanks for posting, awesome job
Just as a heads up to help those of you starting, theres way more than 7.5 hours of tutorial here. With bug fixing, exercises and working on theory discussed its probably closer to 18. To help you time box, you should double the minutes in each section to estimate how long each section will take.
I'm so happy this video blew up, i followed all your series so far and learned so much about pygame. You deserve a lot more subs for your work and top tier content and i hope your channel keeps growing. Thank you :)
i would have loved to see a part two of this where you go even further, like level creation. more enemies. even if it was something that you already delved into. doing more brings certain problems with it and knowing how to handle it is one of the fine tools programmers need to have to make actually full fletched games
Just came out of a Uni CS class where our final project used PYGAME. I can actually understand a lot of what you're doing and it's impeccable. Absolutely love this! Warms my LOZ nerd heart!!
Hey ! So im a mac user and i got stuck during the graphic part of the video (around 1:50:00), the probleme was that i was getting the worng sprites for the objects (getting statues instead of trees, etc.). After a bit of testing i undestood that the Mac os walk function doesnt "walk" throught the directory in the correct order so the list we're creating(image_surf) is unsorted. If u're struggling with the same issue, define a new list to get every images from the walk function, then sort it and iterate angain throught the sorted list. def import_folder(path): surface_list = [] sorted_list = [] for _, __, img_files in walk(path): for image in img_files: sorted_list.append(image) sorted_list.sort() for img in sorted_list: full_path = path + "/" + img image_surf = pygame.image.load(full_path).convert_alpha() surface_list.append(image_surf) It works now, i can keep enjoying your tutorial :)
OMG thank you! I was trying to figure this out by looking at the object csv files and seeing why they didn't match the ones in the video. I have to imagine it would've taken me a long time to consider that the walk() function was a possible culprit. I think there's a shorter way to solve the issue. Just add the line img_files.sort() inside the first for loop, like so: for _, __, img_files in walk(path): img_files.sort() for image in img_files:
I had the same issue, also on mac. The basic sort() was not sufficient for me as I standardized the naming of the files to be n instead of 0n. 0.png, 1.png, 2.png instead of 0.png, 01.png, 02.png etc. I did this because if you had hundreds of files you would have odd names such as 001.png, 002.png and even worse if you were to have thousands or more files. Any how I put this in a try, except block: files = sorted(files, key=lambda file_name: int(file_name.split('.')[0]))
I'm at 2:56:43 right now, so I don't know if it'll be fixed later in the video, but because of the Y-sorting draw of the sprites, the weapon is overlaping the underneath sprite while the player is overlaped by the sprite, I think that to fix this, we should create another group of visible sprites, that will be drawn above all
Finally, I've made the first production with python thanks to you Clear Code! It took me like a month to finish this and I kinda understood how to make a game with python. It helped me a lot to improve for myself. Thank you Again!!
What a great tutorial, thank you so much for putting this together and offering it for free. A real gift to coders getting started with python game creation.
First of all, thank you for your tutorial! You have done a great deal of work:) But when I see some of the decisions you made, my eye twitching a little... The game is absolutely unscalable (may be you will rewrite it later in the video I have seen only an hour of your tutorial yet) . You call update method for all visible objects when in fact only player has update method. You check collisions with all obstacles when you can check only with objects in small area around player. And it absolutely blew my mind when you decided to sort all objects before drawing at each frame!!! When the only thing which changes the relative position is player! I think that you at least have to tell people that there is a better way to write your code:) To be more constructive. The usual way to deal with collisions is geohash. You have to store your collidable objects in a hashmap with rounded coordinates as keys. Then you have constant complexity of computing collisions. And you can store static objects in sorted group apart from dynamic then at each step you will have to sort only dynamic object which are present on the screen. Keeping in mind that you usually have way more static objects than dynamic, it will be a significant reduce in computational complexity.
This concerns me as Im following this for a project due Tuesday, hoping to pick up bits to add to my game, but Im not sure it will be worth it for scalability issues. I've noticed a problem with a lot of things in Pygame tutorials being limited to just what they are doing with not much explanation on the ability for scalability. If you know of anything please let me know
Hey ! I wanted to say thank you. Last weekend there was game jam about the use of AI tools in games. As a data scientist with no game dev experience, I was able thanks to you to get my hands on pygames a few days before and then modify the base code accordingly I really wanted to show the potential of latest LLM in game dev and I'm very proud of the achieved result. But all that was possible because of your tutorial. So many thanks to you. ( apparently I can't share the link to the game I made )
Its funny to me, as a child it was always magical and beyond my scope As a adult in college, it was still magical and beyond my scope Now, nearly 28, it's STILL magical and out of my scope 😂 but there's a lot of cool resources like this video to teach me it's not /as/ crazy as I always believed ❤
Thanks man, what a great tutorial! I had one big issue at the beginning: I got some error messages after setting the sprites in the row and col index and it took me some time to find out that, In my case, the graphic import at 16:31 did not work at all. I had to move the grapics folder to the code folder and get rid of the "../" part in path in both, tile.py and player.py.
I did the same thing, and it took me a little bit to figure it out. The "../" drops back one directory before going to the graphics directory. If you put your code in its own "code" folder instead of in the main folder, it loads the graphics files just fine. Next you need to sort out this error: File "../Zelda Tutorial/code/main.py", line 23, in run self.screen.fill('black') TypeError: invalid color argument I put standardized color tuples into settings.py and tossed in a line importing those settings into debug.py.
i solved it by adding another "/.." to the path Because the reference folder is one level deeper, so it looks like this "../../graphics/test/rock.png", Im returning two folders instead of one
For the player animations this line of code "self.image = animation[int(self.frame_index)]" always causes an error called "IndexError: list index out of range". Does anyone know a reason or a mistake I might have made? Edit: I have now fixed it, it was cause when i was giving a file path for the animations I didn't put a slash at the end
I had the same problem and it was because my update functions in the main script where in for event in pygame.event.get(): instead of just in the while True:
Really appreciate this tutorial! Even though it is pygame related, it contains such great insights into how a project should be structured with as little hardcoding as possible. This one should be watched, no matter if you are into creating games or not.
I'll agree with most of the other comments here and say this tutorial is really well done and contains a lot of information. To build a relatively-fully-functional game of this magnitude in under eight hours all while using the coding segments as learning tools and taking the time to explain things is quite impressive. Well done, indeed! And, yes, I know the maps and graphics were done outside of this tutorial, which would have added significantly to the time, but the point still stands this was an impressive work. Might I suggest breaking videos like this down into smaller chunks? I think one-hour blocks would do well for a game like this, and I feel it would make it easier to come back to after if one can't complete the entire thing in one setting. Just my two cents on the video, but overall, great job!
Does someone know how Clear Code gets these perfect sized graphics? I can only get those small ones that looks awful when I maximize the width and height.
1. Make sure you find good looking assets. Opengamearts and itch.io both have some really good (and free ones) but you do need to look for a bit 2. You can use a pixel scaler (lospec.com/pixel-art-scaler/) that can increase the size of an art asset without losing quality (for pixel art). 3. What also helped is that I set my screen scaling to 250% so that my 4K screen works more like 720p screen, which does make things look better. Obviously that doesn't work for actual games so make sure to focus on step 1 and 2 Hope that helps :)
3:03:20 [Weapon mechanic] I did the mechanics backwards, I hope it can be useful to someone else. This is the code: if keys[pygame.K_w] and self.can_switch_weapon: self.can_switch_weapon = False self.weapon_switch_time = pygame.time.get_ticks() self.key = "W" if ( self.weapon_index 0 ): self.weapon_index -= 1 else: self.weapon_index = len(list(weapon_data.keys())) - 1 self.weapon = list(weapon_data.keys())[self.weapon_index] (Sorry for my english, hehe)
Great tutorial. Running on Mac I started getting some weirdness an hour and a half in due to the weird way that os.walk returns an unsorted list - on linux and windows the list is sorted. I rewrote the import_folder function in support . py to ensure that the image list return is sorted, then I sort on that to make a surface_list. def import_folder(path): image_list = [] surface_list = [] for _,__,img_files in walk(path): for image in img_files: full_path = path + '/' + image image_list.append(full_path) for image in sorted(image_list): image_surf = pygame.image.load(image).convert_alpha() surface_list.append(image_surf) return surface_list
wasted an hour trying to rename each png to the number that would correspond to the right position in the unsorted list before I read this, much appreciation dude
@@ClearCode No problem, love the way you present this content. I've been dink'n around with the idea of game dev for a while and I think your tutorial might finally be the one to give me the push needed.
at 1:44:30 you are using the walk method wich dont aways return a list of files in order. Maybe its bc i'm using 3.8 but idk. Before the second for loop in line 17 i use img_files.sort() so this is in order and the surfaces match perfectly.
Just made my first “hello world” in my python class. Guess it’s time to make Zelda now
I think it should be better if you learned the language first. I talk for experience, doing something without understanding/remembering how to do it by yourself is kind of useless and is going to make you lose lots of hours
@@crops1646 he's being sarcastic bro
@@aperture0 you're probably right but maybe someone else could see this comment and believe it's a great idea
@@crops1646 ah I see your point
@@crops1646 hey i want to be a programmer what language should i study first?
It's honestly mind-boggling that we get this kind of content for free and that well put up together. I can't thank you enough for your work and passion to spread your knowledge! Keep it up, you're great
I agree
So true!
yup.
True that!
Thnx @Clear Code
AI Camp here - we are so proud that we sponsored this great video. Cannot wait for the summer to happen to see what people will create!
Thank you
There are 256 subs right now, why must I be the one who has to ruin such a perfect binary number??
@@harmitchhabra989 leo?
I'm actually in awe to see such a video so well put together. Thank you for sponsoring this!
@@WolfsInk You are mostly welcome!
I can't believe what I am seeing. Just a few weeks ago I nearly gave up in frustration for lack of quality pygame tutorials, specifically for a Zelda style RPG. Then I found your channel and I started on your course at Udemy. I said to myself, I only wish he'd do Zelda. AND OMG here we are. Thank you very much, You have a real knack for knowing your audience... And your devotion to teaching has changed my life.
It seems like you manifested this lesson.
How did it go? Did you make one
@@Drake00000010 A bit of a delay. I had some life stuff happen so I am just now finishing it up. A fantastic tutorial on par with all of his really great content.
@@K5RTO did you do it now?
I thought this was a 7 min video at first :D I was not expecting a programming video when I clicked it, but thank you very much for creating this. It must have taken a lot of work and I appreciate it very much.
I didn't even look at the time, I didn't even see it's 7 fucking hours long.
@MJ You are correct
Same I thought it's just vidoe of somone making pygame zelda than a entire tutorial
What version of python is this
'I didn't watch the video and it isn't useful to me at all but good for you for making it'.
You people don't need to leave a comment wherever you end up.
This channel is actually underrated, he is also the one who made tutorial to make minecraft in Python.
Great tutorials, keep it up
After a couple weeks, I FINALLY finished this tutorial. I had gone through a pygame textbook that was pretty outdated and this introduced me to so many concepts that the book didn't have. Thanks so much for this amazing tutorial!
can i make this with a 4gb ram laptop?
@@dragonriderjohann7683 sure you can
PLS NAME THE BOOK
@BitDifferent
Kwispy cream do you still have the code ? I tried recreating it but it always shows the error
This channel is by far the greatest coding channel judging by the deliverance of information, keep up the good stuff!
Looking forward for more of your great pygame tutorials!
What version of python is this
You're the ultimate GOAT, your videos are incredibly well-organized, making learning a breeze. Plus, you generously provide all this valuable content for FREE! I can't express enough gratitude for the wealth of knowledge you share.
This was a terrific introduction to pygame, the only thing that we forgot to add was a player death mechanic but I'm taking on the challenge on my own and feel well prepared to do so. Thank you so much!
Well, to be fair, he did point it out. Reason he didn't implement it is because it's easier to test your game mechanics if you don't also have to worry about not dying.
can you ask with, passwork of file
I can ask with, passwork of file if I really wanted to. But, can YOU? That's the real question.
i had alot of "importing" errors until i realized i need to (ctrl+s) save each of the modules before running the main module for the updated code to work. great video. i learned quite a bit about pygame. thank you :)
This looks incredible, can't wait to dig into it. Agree with the other comments I'm seeing, this is the *exact* tutorial for PyGame that I've been desiring for a few years now.
For a moment i thought this is just a project made by a team of professionals, the second moment i realized this is a WHOLE tutorial
Holy crap this is next level dude!! Keep up the good work!!
@Florian D. True, python and pygame are great to make games as a side project, but professionaly i would never use pygame. Don't get me wrong I love pygame.
@@foxtro484 what would you recommend then? particularly for C++
@@purpleplantain374 yeah java or c++ is mostly used for making games
What version of python is this
@@loganwow Maybe It Python 3 python 2 is abit too old
As a python enthusiast and huge fan of LoZ/DS games, I'm greatly looking forward to watching this. My first major project a few years ago was creating an old-school text adventure that runs in the CLI, and I created a simple animated dungeon map that can be called from within (using pygame). I've been planning to whip up some sort of 2d adventure game like this next - can't wait to dig in.
Took quite a bit longer than 7.5 hours but successfully completed over a weekend. Thank you so much for this! Looking forward to following along with your other guides
I really appreciate you leaving your mistakes in. It makes a beginner coder like me feel better about myself when I make errors.
I’m an hour in and I can say this: yes, a lot of this is going over my head right now because I don’t have a good enough grasp of Python classes, but WOW. Your presentation is impeccable… perfect pace, great examples, and the logical flow is really helpful. Incredible resource.
What version of python is this
@@loganwow Python 3, I would assume 3.9+
To anyone feeling the same struggle: try watching his other videos in conjunction with this one. Such as the Super Mario video from a year ago and "Creating a platformer in Pygame". If your problem isn't simply understanding Pygame, but programming in general, I suggest practicing with simpler concepts first such as importing libraries, making functions and executables or even simple lists.
You are on of the most underrated UA-camrs on the platform. Thank you for your content.
This is insanity, i've never seen a tutorial like this.... incredibly impressive. I wish I had this a few years ago, it's not so helpful to me now (especially at this length) but if anyone is a beginner this is great!
I think new coders would also benefit from seeing how you divided each pack into your local files because your file locations are integral to your code, but we download them differently from PixelBoy. So as we code, we sort through a lot of things that you have preorganized. Seeing how you have them organized in each file would be helpful in the setup intro part of your vid.
I am a new coder and sorted through those exact problems
I experienced this as well! I love the tutorial,
yeah im stuck i cant even find the rock.png in the pixel boys file
Trust me guys with just a little messing around their is no problem in coding you guys can’t figure out!! I’ve followed so many tutorials since then made 20+ games and became a pygame master and the main thing I’ve taken away from all this was how to problem solve!! You guys got this!!
@@WhatsNextFamso how’d you get your own tile for the rock.png
Sir, I just wanna tell you that you. have changed my life with software, and I admire your teaching style more that anyone's. Thank you for putting out amazing content and never failing to help us.
Who has the audacity to Dislike videos like these? It's truly insane that you can offer a free informative, educational video and somehow that's a bad thing.
You are so my favourite coder on UA-cam. I cant believe that this is so much better and CHEAPER (free) compared to school coding classes.
Keep up the good work!!
Suggestion: pls do another tutorial is python ursina??
This is amazing, and I can't believe I haven't subbed yet. I'm going to be modifying this code for an online-rpg style project I'm working on. Thanks so much for the great tutorial!
This was such an excellent course! Thank you very much for all the time and energy spent in making this!
what a legend, creating zelda in python. can't even imagine doing that with or without motivation
I was wondering how it was possible for such quality content to only have 500 views, but then I realised that I had caught this video just shortly after it had released.
Genius and philanthropist, you just make my day and the world better, congrats and cheers from France
Been watching this video for weeks (I am taking my sweet time) and will be watching it for longer, and I have to say I have never been more excited for a coding tutorial
Oh Wow, the amount of work you put into your videos is overwhelming. Your channel is extremely underrated. Keep it going!
I found your channel by chance with this video and in two days I managed to follow you step by step and actually create the game. You can't even imagine how I happy I am right now!
Thank you very much man, this project must have been really heavy so really thank you so much for doing it and sharing it here!
I am going through the side scrolling videos now, and I can’t wait to get to this one. Looks amazing!!!
Just finished the entire tutorial! Wonderful! Thank you so much for putting this together and teaching pygame.
I’m almost done, I’m thinking of adding new levels. Hell, I might post them on my GitHub
Incredible the quality of your work and sharing this with the whole world for free!!! We can't thank you enough!
Dude, you are just awesome! Very impressive what you build here. Isn´t it awesome that programmers are able to make the inner child live forever this way? :-)
When I started learning Python on my own, I knew the basics but had no idea how to apply what I learned. This project is helping me because many abstract concepts are now solidifying inside my mind. Thank you so, so much for the great content you put out and for your patience, you are an EXCELLENT teacher, really! The effort you put into being thorough in your explanations is greatly appreciated!
I saw you mentioned making this video a while back, I didn't think it would be like this! You've really outdone yourself!
I don’t give a shit.
Thank you so much for the pygame walkthrough! I blew people away in my intro to python class and I only turned in milestone 1 for my project. Which was having collisions working without any of the camera. I am so grateful for your explanations. Keep it up!!
As a fan of both Zelda and Dark Souls, I was ecstatic to find this tutorial. Clear Code, your ability to teach complex concepts in an easy-to-understand manner is truly impressive. Your dedication to providing high-quality, free educational content for aspiring developers is greatly appreciated. I can't wait to start working on my own Python-based RPG using the skills I've learned from your tutorial. Thank you for your hard work and for sharing your knowledge with the world!
Thankss!! This is the first game that I have made following your tutorial and I can't wait to make more adjustments myself!
Wow! This is fantastic! This channel and the Coding with Russ channel are right up there with this type of content and tutorials. Thank you so much for this, it is very much appreciated. The time and effort you have put into this, its astounding! :)
Wow, this is next level! There are some points where I'd solve things differently. E.g. the repetitive if statements in order to assign a value to a variable could've been solved more elegantly using dictionary indexing. And adherence to PEP-8. Small stuff like that. But the presentation is on a level worthy of admiration. The way you explain everything as you go, providing sufficient context or explanation so the audience knows at every moment what you're doing and why. How you break the project into pieces and how you tackle them in succession without losing track of the goal. It's obvious a ton of preparation went into this, way in excess of the almost 8 hours of resulting video. And this is just one of many such videos you've put out so far. Thanks for such great tutorials!
What kind of software/IDE did you use?
The value of what you're giving the world simply can't be overstated, sir. You're an example of the kind of person that spends their time uplifting others and it's a pleasure to learn from you
Heads Off! You are just awesome!!!
More projects like these will be amazing!
I owe Clear code for the conciseness, if not the game design, he teaches you well. You keep it up, Clear code.
You keep it up.
Thank you for the amazing pygame tutorials, you are really underrated.
I'll be honest many times I skipped the announce for the sponsor but I video at this quality can't be rewarded enough, and it's free ! massive thanks to you I've been here for a long time and I am always amazed by the games and logic that you come up with.
These are the best tutorials one can find, thanks for the great content!
What a great tutorial. I have never programmed in python and this most likely will be my first one because it’s awesome! This was also my first SuperThanks$ here on UA-cam. I’ve never seen such amazing work being freely presented. 👏🏻
Here at the second it came and already know its gonna be awesome
I've been watching this a little bit every day and I finally reached the end of the video. This was really cool, and I loved the end result!
Excellent tutorial! Would you be interested in making up a tiny follow-up video to show how to code:
1) a game over "state" upon player death
2) a level "reset/retry" option after the player dies
3) how to load a new level upon clearing an "objective"
Integrate his overworld code from the mario platformer tutorial. Beware though, it resets the exp and menu settings every level... not been able to get the ui and upgrades into the game class yet so they stay with the player each level...
@@mattowen1812 i know I’m late to the party here, but i may have figured out a solution to this. Let me know if you’re still stuck
@@thatguy-cf5gs Hi. What was your solution eventually? I think I put all player variables I want to persist in a dictionary in the settings file.
Alternatively, a method that passes current_exp to a new_exp variable then create level function with the new_exp passed in.
I did this with my metroidvania here with the weapons the player has when swapping levels (or rooms in this case) m.ua-cam.com/video/KhVwVFdolJs/v-deo.html
Many thanks for this tutorial and all the hard work that must have gone into it. I got to the end of this project.
00:03 Creating a Zelda style RPG with sophisticated graphics and mechanics.
02:46 Setting up game variables and world map layout
07:21 Setting up the display and creating the level class
09:31 Sprites can be placed in different groups for interacting with the environment differently.
14:10 Creating a flexible tile class with sprite inheritance
16:28 Setting up graphics and player classes
20:43 Setting up the world map in Python with Dark Souls elements
22:53 Converting world map into positions using row and column indexes.
27:05 Setting up player and basic level setup.
29:01 Adding player direction and keyboard input
33:15 Implementing keyboard input for player movement
35:21 Implementing player movement with speed in Python game
39:25 Separating move method for player and enemies for flexibility
41:19 Implementing player collisions in Python game
45:36 Adjust player positioning to avoid overlapping with obstacles.
47:42 Implementing player movement and collision detection
52:00 Inheriting from pygame.sprite.group for camera functionality and sprite sorting
54:10 Implementing custom draw for sprites
58:07 Implementing game offset and connecting it to the player position.
1:00:19 Implementing camera movement in the game
1:04:31 Moving hitbox to manage collisions and player position
1:06:38 Implement custom hitboxes for player and tiles
1:10:44 Basic top-down game with camera, collisions, and good visuals.
1:12:50 Building the map layer by layer
1:16:51 Adding a surface and rectangle for the floor
1:18:52 Implement offset for drawing floor surface
1:23:04 Adding parameters to title class
1:25:08 Importing and converting CSV files for creating a world map in Python
1:29:27 Creating a separate container for terrain map
1:31:25 Creating style and layout for the game world map.
1:35:47 Correcting coding error and testing game functionality.
1:37:56 Importing grass and object layouts for tile creation in the game.
1:42:03 Loading images in a Zelda style game
1:44:18 Importing and organizing graphics for the game level.
1:48:44 Using ids for indexing images and objects in tiled.
1:50:52 Adjusting placement for larger objects in the game.
1:55:09 Creating player animations for different actions
1:57:10 Implementing attack and magic inputs with key controls
2:01:25 Creating a custom timer for tracking game events
2:03:38 Implementing a cooldown system for attacks and magic.
2:07:57 Creating a full path to import graphics for player states
2:10:16 Setting up state management for player animations.
2:14:25 Implementing player movement directions based on input
2:16:37 Handling player movement and idling in the game.
2:20:50 Replacing idle status with attack status
2:23:00 Implementing player status and animation logic
2:27:09 Setting image and frame index for animation
2:29:21 Implementing player animations and weapons
2:33:35 Positioning the player and weapon correctly
2:35:40 Creating a method to handle player attack functionality.
2:39:45 Using the split method in Python for game development
2:41:44 Positioning weapon relative to player
2:45:57 Adjusting weapon placement and graphics in the game
2:48:03 Implementing weapon selection and image display
2:52:23 Creating a method to despawn weapons
2:54:34 Implementing weapon switching and attack mechanics
2:58:47 Update weapon functionality in Python game
3:01:02 Implementing weapon cooldowns for switching
3:05:13 Creating user interface elements like health bar and energy bar and key player attributes through dictionary.
3:07:12 Creating player stats and starting the UI
3:11:15 Setting up UI elements and colors for the game
3:13:14 Setting up health and energy bars in the game interface
3:17:26 Drawing health and energy bars in Python with required ratios
3:19:27 Calculating pixel width based on health ratio
3:23:39 Implementing the experience system
3:25:44 Placing text surface on bottom right corner of game window
3:29:47 Customizing Rectangles in Pygame
3:31:44 Creating a selection box for weapon background
3:35:50 Implementing weapon index for surface placement
3:37:46 Creating weapon graphics from settings
3:41:57 Changing border colors and weapon selection implementation
3:43:54 Implementing magic abilities and UI in the game
3:47:55 Implementing magic creation in the game
3:49:55 Accessing and using dictionary values for game mechanics
3:54:08 Adding cooldown logic for magic switch
3:56:12 Implementing magic overlay UI
4:00:26 Implementing shared methods for player and monsters.
4:02:23 Explaining attributes and mechanics of enemy characters
4:06:36 Setting up the basic attributes for enemies.
4:08:46 Setting up monster names and positions
4:12:43 Creating player based on tile set IDs
4:14:46 Implementing enemy class for basic sprite creation
4:18:50 Creating individual enemy paths and importing graphics
4:20:55 Setting monster animation based on status
4:25:19 Implementing enemy movement and hitbox in the game.
4:27:25 Implementing enemy movement and stats
4:31:34 Implementing enemy movement based on player distance and direction
4:33:44 Understanding vector relations and converting to distance
4:37:48 Handling player-enemy collision
4:39:50 Implementing enemy updates and filtering enemy sprites
4:43:56 Implementing player status and movement logic
4:46:08 Animating enemies with similar steps as the player
4:50:16 Managing enemy attack behavior
4:52:21 Creating a timer for enemy attack cooldown.
4:56:53 Implementing player-enemy interaction logic
4:58:41 Creating groups for attackable sprites
5:02:39 Implementing collision detection and sprite destruction in the game.
5:04:42 Implementing sprite destruction and damage calculation in Python game.
5:08:34 Calculating total damage from base and weapon damage
5:14:52 Implementing enemy hit mechanics
5:17:03 Implementing hit reactions for enemies in the game
5:21:24 Implementing a function to toggle between 0 and 255 using a sine wave in Python
5:23:31 Implementing flicker effect for the player character
5:27:38 Implementing enemy damage functionality
5:29:48 Implementing vulnerability and invulnerability mechanics.
5:34:06 Creating a new particle effect in Python
5:36:17 Implementing animation control in the game
5:40:32 Implementing particle effects using animation player
5:42:39 Creating particle effects with random animations
5:47:05 Adjusting particle effects and generating enemy particles
5:49:23 Creating a function for playing particles during player attacks
5:53:53 Creating trigger death particles for enemy animations.
5:56:09 Implementing magic spells in the game
6:00:06 Setting up parameters for the heal spell
6:02:00 Managing player health and energy in the game.
6:06:07 Implementing energy recovery method for player
6:08:20 Adjusting player attributes and magic recovery in game development.
6:12:31 Creating directional vectors for movement in the game
6:14:32 Implementing proper for loop and splitting the math into horizontal and vertical directions
6:18:56 Implementing random offset for flames in game
6:21:01 Implementing flame spell functionality
6:25:06 Implementing magic and upgrade mechanics in the game
6:27:11 Implementing an experience (XP) mechanic
6:31:45 Implementing player stat increase and menu functionality
6:34:02 Creating an upgrade menu for the game
6:38:20 Implementing mechanics for left and right movement
6:40:23 Implementing player stats, keys, font, and selection system
6:44:52 Implementing selection index and optimizing UI for game window
6:46:53 Creating item dimensions for Zelda game elements
6:51:00 Setting up window dimensions and element positioning
6:52:50 Creating left side elements and offsetting elements to the left
6:57:02 Displaying item attributes and names
6:59:06 Implementing getter methods for values and cost by index
7:03:21 Implementing title and cost display on surfaces
7:05:38 Implementing cost display and item selection highlighting
7:10:01 Implementing item selection visuals
7:12:01 Implementing a progress bar for player's skill level
7:15:59 Calculating relative number for health bar
7:17:58 Implementing a trigger method to upgrade attributes in the game
7:22:24 Implementing player upgrades and attribute checks
7:24:31 Fix visual issues and add water background
7:28:25 Enhancing movement and sound effects for the game
7:30:29 Adding sound effects to the game elements
7:35:16 Implementing attack sounds for different enemies
7:37:34 Adjusting sound volume and effects for better gameplay experience.
I am glad to see there are always talents people like you who willing to produce such quality and FREE courses for all, this is meaningful, splendid, and much appreciated! Please produce more quality courses, for the whole industry and humanity.
I made it through the whole thing. Thanks a million!
This was such an amazing project! I really wanted to start making adventurous games such as Pokémon and I have to say this tutorial covers already so much amazing what you did! You are amazing!
I love the game and the art!
I am only 10 minutes in and I am loving it. Not only he is explaining it but we are also getting challenges as the opportunity to do some learning by ourselves.
Can't wait to give this a shot and learn. I've been interested in a Zelda clone but Most are super old /outdated.
Hey there! Just finished this tutorial among other you have uploaded. Just off to say you make really good resources for people to learn new things. Keep it up and THANK YOU.
You deserve much more subs 😃😃
This is absolutely amazing. Instantly subscribed. I’ve always wanted to create a game like this style using Python, this is great! Thanks for posting, awesome job
Just as a heads up to help those of you starting, theres way more than 7.5 hours of tutorial here. With bug fixing, exercises and working on theory discussed its probably closer to 18. To help you time box, you should double the minutes in each section to estimate how long each section will take.
I'm so happy this video blew up, i followed all your series so far and learned so much about pygame. You deserve a lot more subs for your work and top tier content and i hope your channel keeps growing. Thank you :)
Это очень крутая работа!!!! Спасибо тебе большое за проделанную сложную работу. Уже потерял надежду и думал, что это невозможно на Python.
Согласен. Многие почему-то думают, что Python годится только для каких-нибудь простеньких приложений.
yes i love python so much
i would have loved to see a part two of this where you go even further, like level creation. more enemies. even if it was something that you already delved into. doing more brings certain problems with it and knowing how to handle it is one of the fine tools programmers need to have to make actually full fletched games
this tutorial is fantastic!
Just came out of a Uni CS class where our final project used PYGAME. I can actually understand a lot of what you're doing and it's impeccable. Absolutely love this! Warms my LOZ nerd heart!!
Hey !
So im a mac user and i got stuck during the graphic part of the video (around 1:50:00), the probleme was that i was getting the worng sprites for the objects (getting statues instead of trees, etc.).
After a bit of testing i undestood that the Mac os walk function doesnt "walk" throught the directory in the correct order so the list we're creating(image_surf) is unsorted.
If u're struggling with the same issue, define a new list to get every images from the walk function, then sort it and iterate angain throught the sorted list.
def import_folder(path):
surface_list = []
sorted_list = []
for _, __, img_files in walk(path):
for image in img_files:
sorted_list.append(image)
sorted_list.sort()
for img in sorted_list:
full_path = path + "/" + img
image_surf = pygame.image.load(full_path).convert_alpha()
surface_list.append(image_surf)
It works now, i can keep enjoying your tutorial :)
Hey, I run into the same problem as you did, but I wouldn't ever solve it on my own. Thanks a lot for your help!
Thank you so much! I was stuck on this too on Mac
why can't i run?
"pygame.error: Unsupported image format"
OMG thank you! I was trying to figure this out by looking at the object csv files and seeing why they didn't match the ones in the video. I have to imagine it would've taken me a long time to consider that the walk() function was a possible culprit.
I think there's a shorter way to solve the issue. Just add the line img_files.sort() inside the first for loop, like so:
for _, __, img_files in walk(path):
img_files.sort()
for image in img_files:
I had the same issue, also on mac. The basic sort() was not sufficient for me as I standardized the naming of the files to be n instead of 0n. 0.png, 1.png, 2.png instead of 0.png, 01.png, 02.png etc. I did this because if you had hundreds of files you would have odd names such as 001.png, 002.png and even worse if you were to have thousands or more files.
Any how I put this in a try, except block:
files = sorted(files, key=lambda file_name: int(file_name.split('.')[0]))
I'm at 2:56:43 right now, so I don't know if it'll be fixed later in the video, but because of the Y-sorting draw of the sprites, the weapon is overlaping the underneath sprite while the player is overlaped by the sprite, I think that to fix this, we should create another group of visible sprites, that will be drawn above all
Finally, I've made the first production with python thanks to you Clear Code! It took me like a month to finish this and I kinda understood how to make a game with python. It helped me a lot to improve for myself. Thank you Again!!
If you enjoy this tutorial check out my pygame course: www.udemy.com/course/learn-python-by-making-games/?referralCode=A80FECE8C76096E01111
Already own it :)
Thanks. Shalom.
Really impressive training session!! Great work, my friend!
How is this free?
Please keep up this amazing work
I paused the video with your first challenge. I'll be back tomorrow morning, this may be the first tutorial I actually sit down and work through
It's Awesome
What a great tutorial, thank you so much for putting this together and offering it for free. A real gift to coders getting started with python game creation.
First of all, thank you for your tutorial! You have done a great deal of work:)
But when I see some of the decisions you made, my eye twitching a little...
The game is absolutely unscalable (may be you will rewrite it later in the video I have seen only an hour of your tutorial yet) . You call update method for all visible objects when in fact only player has update method. You check collisions with all obstacles when you can check only with objects in small area around player. And it absolutely blew my mind when you decided to sort all objects before drawing at each frame!!! When the only thing which changes the relative position is player!
I think that you at least have to tell people that there is a better way to write your code:)
To be more constructive. The usual way to deal with collisions is geohash. You have to store your collidable objects in a hashmap with rounded coordinates as keys. Then you have constant complexity of computing collisions.
And you can store static objects in sorted group apart from dynamic then at each step you will have to sort only dynamic object which are present on the screen. Keeping in mind that you usually have way more static objects than dynamic, it will be a significant reduce in computational complexity.
This concerns me as Im following this for a project due Tuesday, hoping to pick up bits to add to my game, but Im not sure it will be worth it for scalability issues. I've noticed a problem with a lot of things in Pygame tutorials being limited to just what they are doing with not much explanation on the ability for scalability. If you know of anything please let me know
Hey ! I wanted to say thank you. Last weekend there was game jam about the use of AI tools in games.
As a data scientist with no game dev experience, I was able thanks to you to get my hands on pygames a few days before and then modify the base code accordingly
I really wanted to show the potential of latest LLM in game dev and I'm very proud of the achieved result.
But all that was possible because of your tutorial.
So many thanks to you. ( apparently I can't share the link to the game I made )
Update : I finished 4th place of the hugging face game jam thanks to you :) the game : everchanging quest
Its funny to me, as a child it was always magical and beyond my scope
As a adult in college, it was still magical and beyond my scope
Now, nearly 28, it's STILL magical and out of my scope 😂 but there's a lot of cool resources like this video to teach me it's not /as/ crazy as I always believed ❤
Omg this was some next level effort. Dont know if I'll ever come to get to this tutorial, but thanks for doing it!
Thanks man, what a great tutorial! I had one big issue at the beginning: I got some error messages after setting the sprites in the row and col index and it took me some time to find out that, In my case, the graphic import at 16:31 did not work at all. I had to move the grapics folder to the code folder and get rid of the "../" part in path in both, tile.py and player.py.
I did the same thing, and it took me a little bit to figure it out. The "../" drops back one directory before going to the graphics directory. If you put your code in its own "code" folder instead of in the main folder, it loads the graphics files just fine. Next you need to sort out this error:
File "../Zelda Tutorial/code/main.py", line 23, in run
self.screen.fill('black')
TypeError: invalid color argument
I put standardized color tuples into settings.py and tossed in a line importing those settings into debug.py.
or u can just remove one of the dots
i solved it by adding another "/.." to the path
Because the reference folder is one level deeper, so it looks like this
"../../graphics/test/rock.png",
Im returning two folders instead of one
This is so great! I can't wait until I can get on this level of programming and can follow along with this and genuinely understand it!
This is such an amazing tutorial! Will you be able to do a dialog box and npc interaction video?
As an newcomer to python and coding in general, I can't thank you enough for your video. Cheers from Brazil.
For the player animations this line of code "self.image = animation[int(self.frame_index)]" always causes an error called "IndexError: list index out of range". Does anyone know a reason or a mistake I might have made?
Edit: I have now fixed it, it was cause when i was giving a file path for the animations I didn't put a slash at the end
Thank you so much, I had the exact same issue
I have this specific mistake too; what file path for the animations are you referring to? the player’s?
Loving this tutorial! I am a granny gamer who is now working on creating a few games. This is helping me on that journey.
my player is only updating when i release the key, so only moving at 5px per key released and not while holding the key down. any fix?
I had the same problem and it was because my update functions in the main script where in for event in pygame.event.get(): instead of just in the while True:
Really appreciate this tutorial! Even though it is pygame related, it contains such great insights into how a project should be structured with as little hardcoding as possible.
This one should be watched, no matter if you are into creating games or not.
What should I do first, the mario game or zelda(in terms of which one is more difficult)?
Mario first, I'd say but they are equal in difficulty
I'll agree with most of the other comments here and say this tutorial is really well done and contains a lot of information. To build a relatively-fully-functional game of this magnitude in under eight hours all while using the coding segments as learning tools and taking the time to explain things is quite impressive. Well done, indeed! And, yes, I know the maps and graphics were done outside of this tutorial, which would have added significantly to the time, but the point still stands this was an impressive work.
Might I suggest breaking videos like this down into smaller chunks? I think one-hour blocks would do well for a game like this, and I feel it would make it easier to come back to after if one can't complete the entire thing in one setting. Just my two cents on the video, but overall, great job!
Does someone know how Clear Code gets these perfect sized graphics? I can only get those small ones that looks awful when I maximize the width and height.
1. Make sure you find good looking assets. Opengamearts and itch.io both have some really good (and free ones) but you do need to look for a bit
2. You can use a pixel scaler (lospec.com/pixel-art-scaler/) that can increase the size of an art asset without losing quality (for pixel art).
3. What also helped is that I set my screen scaling to 250% so that my 4K screen works more like 720p screen, which does make things look better. Obviously that doesn't work for actual games so make sure to focus on step 1 and 2
Hope that helps :)
@@ClearCode Yes it does, thanks! :D
Finally somebody who is showing how to do serious code organisation. Thank you! :D
3:03:20 [Weapon mechanic]
I did the mechanics backwards, I hope it can be useful to someone else. This is the code:
if keys[pygame.K_w] and self.can_switch_weapon:
self.can_switch_weapon = False
self.weapon_switch_time = pygame.time.get_ticks()
self.key = "W"
if (
self.weapon_index 0
):
self.weapon_index -= 1
else:
self.weapon_index = len(list(weapon_data.keys())) - 1
self.weapon = list(weapon_data.keys())[self.weapon_index]
(Sorry for my english, hehe)
I have finally reached the end! Thank you very much for all of that hard work :)
Great tutorial. Running on Mac I started getting some weirdness an hour and a half in due to the weird way that os.walk returns an unsorted list - on linux and windows the list is sorted. I rewrote the import_folder function in support . py to ensure that the image list return is sorted, then I sort on that to make a surface_list.
def import_folder(path):
image_list = []
surface_list = []
for _,__,img_files in walk(path):
for image in img_files:
full_path = path + '/' + image
image_list.append(full_path)
for image in sorted(image_list):
image_surf = pygame.image.load(image).convert_alpha()
surface_list.append(image_surf)
return surface_list
omfg, u saved my life bro, thx
wasted an hour trying to rename each png to the number that would correspond to the right position in the unsorted list before I read this, much appreciation dude
Thanks!
Thank you so much! :)
@@ClearCode No problem, love the way you present this content. I've been dink'n around with the idea of game dev for a while and I think your tutorial might finally be the one to give me the push needed.
at 1:44:30 you are using the walk method wich dont aways return a list of files in order. Maybe its bc i'm using 3.8 but idk. Before the second for loop in line 17 i use img_files.sort() so this is in order and the surfaces match perfectly.
Thanks for that solution... I had the same problem
excuse me I am at 1:50:37 and the code gives me an error for this line of code "surf = graphics['oggetti'][int(col)]", do you know why could give it ?