OMG this was awesome man. i cant thank you enough. i have just started programming with a dream career of being a software engineer and this was a great tutorial to help me learn. i completely finished the project and am now fiddling around with certain aspects to make it my own. Thank you!!!!
@lemastertech
2 жыл бұрын
So glad to hear it! You can do it for sure, good luck!!!
@dogushangunduzer5659
11 ай бұрын
Hi! This is being my first training project, imma just say BRO WOW, you are such a delicate and resourceful teacher, i have walked through the lecture like a butter, and all worked magic, thanks to you, and I HAVE A GREAT GAME TYPED BY ME! that/this is the most valuable milestone for one, who has just gotten into gaming/pygame. THANK YOU THOUSAND! What a guy.
@lemastertech
11 ай бұрын
Hey! Thank you so much for that awesome comment I’m so glad you liked it and I hope you enjoy the channel!!
@splooper773
2 жыл бұрын
COLOR LIBRARY SCRIPT: #color library red = (255, 0, 0) green = (0, 255, 0) blue = (0, 0, 255) white = (255, 255, 255) black = (0, 0, 0) purple = (127, 0, 255) orange = (255, 165, 0)
@lemastertech
2 жыл бұрын
Thanks for putting this together!
@splooper773
2 жыл бұрын
@@lemastertech Can you help me? I'm trying to add datastore to this but iodk how
@lemastertech
2 жыл бұрын
As in saving your progress when you close the game and resuming right there when you reopen? I made some videos on how to read and write to external text files for your games that you might find useful!
@splooper773
2 жыл бұрын
@@lemastertech ok Cheers!
@TheDeckersC
2 жыл бұрын
Brilliant! TYSM 👏 now going to play around to add more features I.e. multi buy, achievement messages and then icons too 😬😁
@lemastertech
2 жыл бұрын
Heck yeah dude that sounds awesome! Glad you liked the video sounds like yours is gonna be amazing!
@Dingus_Guitars
2 жыл бұрын
Good video, I appreciate the tutorial, I learned a bit of how functions work, and it really helped me grasp the concept of functions in python.
@lemastertech
2 жыл бұрын
So glad you found it useful! Glad I could help and good luck with your projects!
@Lestro
Жыл бұрын
Thanks, man :) First idle clicker game I created because of your help.
@lemastertech
Жыл бұрын
You’re welcome!! Good job I’m so glad you liked it :)
@BossyPK2004
Жыл бұрын
Good vid men. A question: How do I create a button that allows me to accelerate the speed of the bars and that all the purchase buttons are on a separate screen? A shopping menu go. It's more or less understood, isn't it? Sorry for my english lvl.
@BossyPK2004
Жыл бұрын
Could you create a video on how to add these small basic improvements or explain how to do it? I have tried to find a way and I don't know what to do anymore. My programming level is not that high. But it helped me to learn how the functions work thanks to your video. I have the idle clicker done. I only ask for the above mentioned.
@lemastertech
Жыл бұрын
Hi I did a whole video on my channels on how to add PyGame menus, and the basics are just make everything you want to draw on screen when on the main screen just under an if menu is false condition, then the menu stuff draw on screen if menu equals true! Then for accelerating all the bars you can just add some “if power up is True” code and have a temporary power up where you multiply all the regular colors speeds by 10 or whatever power up you want if it’s true! Goodluck!
@BossyPK2004
Жыл бұрын
@@lemastertech Thanks men :D
@naveenketterer1738
2 жыл бұрын
Do you know how I could make a "per second" function that still runs while i do other stuff? I tried making it with threading but it didn't work. I asked on StackOverflow and i got a response that said I cant hijack events in the main loop but I have no idea what it means.
@lemastertech
2 жыл бұрын
Hi I’m not exactly sure what application you’re using it for but it sounds like you’ll want to look into using the pygame.time.Clock.get_time function! It will look at what the previous clock tick was, then you could compare it to see if it equals 1 (or any value) and only run your function when that is true!
@rizwanrehman8598
8 ай бұрын
Hey LeMaster tech, first of all AMAZING tutorial I really loved it please do keep making such awesome tutorials like this one. Although I just have a quick question though: in this code is there any lists involved in this code to help simplify some stuff? If not, do you think it is possible to make a list a with some of the game variable maybe? (Thanking you in advance!)
@lemastertech
8 ай бұрын
Hi! Yes this is one of my older projects and you could certainly make each task an object of a class and that would be much more pythonic and a lot cleaner! I do this in my newer projects a lot better 😁
@rizwanrehman8598
8 ай бұрын
@@lemastertech Hello again. Thank you for your feedback. I just have a follow up question whether or not the list I made is used correctly or not. *My lists that I made* colors = ['green', 'red', 'orange', 'blue', 'white'] costs = [10, 20, 300, 400, 1000] owned = [False, False, False, False, False] manager_costs = [100, 500, 1800, 4000, 9000] *using the list* def draw_buttons(color, x_coord, cost, owned, manager_cost): color = colors[color] cost = costs[color] Would this use the list when I run the program? I just have this feeling like there's some minor error that is being unnoticed by me so an extra pair of eyes would really be helpful in seeing the code for this program. Thanking you in advance for helping out!!
@niklashannemann8482
7 ай бұрын
@@rizwanrehman8598 if you work like that you would not need to get "cost" or any of the other variables into the function, because you take the variable out of the list using the index value you get from inputting "color" Lets say you give it the color colors[0] which is green draw_buttons(0, x_coord): color = colors[0] #green cost = costs[0] #10 owned = owned[0] #False manager_cost = manager_costs[0] #100 for owned and manager costs you would need the same code as you used for color and costs but using their lists respectively But answering your original question yes, you would use the lists. It just display warning messages I think (alternative would be not running at all) that you give your function unused variables For later on changing the values in the list I would recommend w3schools as a website. I learned Java, C++ and C# through them and am currently getting into python. The things above I already can implement on my own, but changing lists is not in my reportoire so far
@satyreyes
Жыл бұрын
You've probably addressed this a thousand times, but what Python editor are you using?
@lemastertech
Жыл бұрын
Hi, no worries- I use pycharm! its free from jetbrains.org
@Nasengold
Жыл бұрын
Thanks for the tutorial. I'm gonna try and refactor that mess in order to learn how to do that.
@lemastertech
Жыл бұрын
Thanks for watching, and yeah this was an early project for me and its a bit of spaghetti code for sure! I have gotten better since then haha!
@Azmedon-AU
2 жыл бұрын
Thanks this was awesome and easy to follow.
@lemastertech
2 жыл бұрын
You’re welcome, glad you liked it, thanks for watching!!
@kamhawkz1001
8 ай бұрын
I've got 1 problem with the code, on the screen fill(background) section it says under the green_buy, green_manager_buy the error is : typeError: cannot unpack non-literable nonetype object, any help?
@lemastertech
8 ай бұрын
Hi, you should not get a nonetype error unless you have a variable that never got initialized at the top of the program! Try making sure everything is properly initialized
@achillariouss5698
2 жыл бұрын
Hello! im at 10:10 and when i run my code the window opens but nothing in it but when i close it just 3 seconds before it closes the circles and rectangles show up any solutions?
@lemastertech
2 жыл бұрын
Hi! I would make sure your indentation doesn’t have the draw task lines inside the for event in PyGame.event.get loop! You want to make sure everything is being drawn outside of that loop so be really careful with indentation!
@ballkidjet3776
Жыл бұрын
Hi! this is such an amazing and useful tutorial so thank you so much for it. However, i was wondering how or if you could add a feature where you only start with one bar, and are required to purchase the others, for example, you start off with only the green one and then unlock the red, orange, white and purple by paying for them. Thanks and great tutorial again!
@lemastertech
Жыл бұрын
Hi! You can definitely add that to this project! Its a pretty simple concept so I'm not gonna do a whole video on that I don't think, but basically just add another button similar to how the manager buttons work, and just make it so the task is only drawn on the screen if red_purchased == True or something to that effect! It's a very cool idea, good luck!
@ballkidjet3776
Жыл бұрын
@@lemastertech Hey, sry me again. I've been trying to add this feature but i cant seem to figure it out, so if you dont mind me asking if you could show me a small example of it here? I understand if you dont want to, as Im sure you have much more important things to do, but it would be really appreciated if you could. Thanks!
@silvazz0
2 жыл бұрын
bro you really are helping me, I'm making a game for me and my friends, it's like a Elon Musk Simulator, but with memes and you make lots of money, I think it's funny and this video is perfect to learn how to make this game thanks :))
@lemastertech
2 жыл бұрын
Haha that sounds super fun man!! I’m glad the video is helping! I hope you like the channel thanks for watching and good luck with your game!!
@hiperz6125
2 жыл бұрын
Hey great tutorial! Im just getting into programming, and i was wondern wheter its a good idea to do the things like tasks, as a object from a class? And what are the advantages and disadvantages
@lemastertech
2 жыл бұрын
Hey that’s a great question! Creating a task class is absolutely a great way to go about this since virtually all the code for each task is repeated for each individual task with just slightly different parameters! The advantages would be cleaner code and any time you wanted to change how the tasks operate you’d only have to make that task once and really the only downside would be if you wanted a bunch of unique attributes in one task! It really is a perfect opportunity to utilize a class and I just didn’t do it here because I didn’t think of it at the time! Happy coding
@hiperz6125
2 жыл бұрын
@@lemastertech Thanks for your fast answer!
@lemastertech
2 жыл бұрын
@@hiperz6125 You got it, good luck with your projects!
@Netherilt
Жыл бұрын
AWESOME TUTORIAL, MANY THANKS
@lemastertech
Жыл бұрын
You’re very welcome thank you for watching!!
@DouweHummeling
5 ай бұрын
One of the issues I came across, is that the 2 last bars (I gave them orange and purple colors) don't fill automatically when the manager is bought. Did you come across this aswell, and if so, what was your fix?
@lemastertech
5 ай бұрын
Hi, all you should have to do is click on the task once when you buy a new manager and it’ll auto renew after that but I do think you have to at least click it once! I did sort of run into that and made a follow up version of the game with a class for tasks instead of defining them all individually and that seemed to help troubleshooting a lot!
@elliotanimations1067
2 ай бұрын
Would be good if you could start by showing us how to install the module you imported, it seems like you skip the most important step
@lemastertech
2 ай бұрын
Hi, importing PyGame and doing pip install PyGame is something I would expect anyone looking to build a whole game to be able to do
@VideoGamingKaos
9 ай бұрын
So loved this video. And I've enjoined making this somewhat my own creation and fooling around with the code as I learn. I was wondering if there is any way to incorporate a number crunching code into this and how it would be done. Trying to find the answer.
@lemastertech
9 ай бұрын
Hi - for sure there’s a way you can put any code you want in here but I’m not super clear on what you mean by number crunching? Thanks for watching and commenting! 😊
@VideoGamingKaos
9 ай бұрын
@@lemastertech Like instead of 5000000 a number would read 5M or 5.6M for 5600000
@niklashannemann8482
7 ай бұрын
@@VideoGamingKaos I think the best would be to work with different variables. One for display (a string) and one fore the math The one for display would crunch like this as example: if number_math >= 1000000 #Lets say its 1250000 number_mathingstuff = round(number_math/1000000, 2) #number_mathingstuff would be 1.25 number_display = str(number_mathingstuff) + "M" #number_display would be 1.25M This would give you a "crunched" Number for display, in this case its Millions, while still keeping your score safe for math purposes behind the screen
@VideoGamingKaos
7 ай бұрын
@@niklashannemann8482 Thanks!
@1wxshenron
Жыл бұрын
Hey bro, nice vid! But could you please make a vid about how to make a cookie clicker! would be pretty helpful, or some a little bit detailed idle game that uses more artwork and mechanics! thanks
@lemastertech
Жыл бұрын
Hi, interesting idea! In my platformer tutorial I show a lot of using art and images and animations, so I don’t know if I’ll do another video on an idle clicker game. I usually try to make sure all my new videos are mostly on new concepts and I have pretty much covered most of that before! But I’ll consider it! Thank you for watching!
@ClaytonMalarkey
Ай бұрын
Hey can you do publishing and adding leaderboards and other multi-player features
@lemastertech
Ай бұрын
If I add features to this project now I would probably remake it from the ground up because there’s a lot of optimization I would add! Not sure when I’ll get to it though
@ClaytonMalarkey
Ай бұрын
@lemastertech please do it I made what you had so far but for a ps vita screen 544 by 960 and I adjusted the lengths of the bars to be 800 and I centered the bottom buttons
@ClaytonMalarkey
Ай бұрын
@@lemastertech are you on discord
@ryanslittleplace
3 ай бұрын
Im not getting the print of the rectangle and the circle help
@lemastertech
3 ай бұрын
Hi as in they are not showing on the screen or you are not able to click on them?
@Bradley.Bristol1
Жыл бұрын
Thanks a lot for the upload, I'm new to python and this has been fun to follow along picking up new stuff. I have gotten up to the mouse click function and I'm very excited about it so far. Oddly enough when I ran my version, I click the buttons once and they continuously fill their respective bars instead of following the elif statement. I checked by taking the = out of the elif length >= 200 part, so that the bars fill and then stop, and for some reason only orange wants to continuously fill! So silly its driving me nuts ha! I think I've re watched the first 18 minutes quite a few times now I'm just not sure how to fix the issue, yet! Gonna take a break and get back at er!
@lemastertech
Жыл бұрын
Haha oh man im sorry to hear somethings going wonky on you but I’m really glad you’ve been enjoying it! I actually started my channel as a self taught programmer and have gotten much better myself doing a lot of these big projects as well so I promise some of my newer projects are explained a bit better too!! If you get too stuck let me know and I can try to help with troubleshooting! Thanks for watching my friend!!
@Bradley.Bristol1
Жыл бұрын
@@lemastertech I managed to fix the issue i was having, pesky commas haha. I swear some dots and commas areso well hidden! I managed to follow to the end I'm excited to tweek this one a little bit and try another mini project, youre right its actually not bad right from the get-go. thanks a lot for the upload!
@decemberkris
9 ай бұрын
what if this was on a document that i may be able to copy and paste so i can play it...
@lemastertech
9 ай бұрын
Hi I am a KZitem channel so my content is in the form of KZitem videos - you want stack overflow or GitHub, check stack overflow or GitHub
@bzandcousinsgaming_bloxfruits
2 ай бұрын
what type of python launcher do you use
@AimekReacts
2 жыл бұрын
where do you write this code? i downloaded Python and Pygame but neither pull up this editor
@lemastertech
2 жыл бұрын
Hello, I use an IDE called pycharm from jetbrains.org!
@AimekReacts
Ай бұрын
@@lemastertechliterally clicked on this comment because it answered my question and it’s my old comment 💀
@EliSvoboda
7 ай бұрын
Ive got a problem. my problem is when I run the game the window doesnt pop up 6:07
@lemastertech
7 ай бұрын
Hi - does it give you any errors when you try to run it or it just isn’t showing the window?
@oliversampson6833
2 жыл бұрын
where do you define the task variable in the reuturn bit in part 2? i can't run mine from there on as it says it is undefined
@lemastertech
2 жыл бұрын
Hi! Anything in a return statement inside a function will need to be defined inside the function somewhere. I'm not sure exactly where in the video you are, but make sure if you're trying to return something it has to exist in the function. If you are getting an error, let me know what the error says! Good luck!
@Zerler_1
4 ай бұрын
Can you send me the script? I've watched the video many times but I still can't play the game. Thanks in advance and sorry for my bad English.
@lemastertech
4 ай бұрын
Hi your English is fine! And I’m sorry I don’t still have this project this was before I started making everything in a GitHub, if I ever do a new version I’ll be sure to add that to a github
@xxxxxxxxxxxxxxxx6189
2 жыл бұрын
hi, nice job! any chance for sharing the code?
@lemastertech
2 жыл бұрын
Hi! Sorry I don’t know how I missed this comment but I can send you the code via email if you would like ! I don’t have a GitHub repro for this one
@STEFFMUSICOFFICIAL
2 жыл бұрын
@@lemastertech anyway i can get a link of that by chance? i'm tryna show my buddy the concept of it.
@lemastertech
2 жыл бұрын
@@STEFFMUSICOFFICIAL Hi I am sorry but this whole project was on my old laptop and was before I started putting my bigger projects onto github so I have sadly lost this one :( I put all my newer big projects on and back everything up on my new laptop lol! If you want to quickly grasp the concept of an idle clicker though feel free to check out adventure capitalist on the app store - its the type of game I built this project in the style of! github.com/plemaster01
@usernameok6078
2 жыл бұрын
this good
@lemastertech
2 жыл бұрын
thank you!!!
@M4TR1XXXX
11 ай бұрын
How do I add a txt folder it says that it didn’t exist
@lemastertech
11 ай бұрын
Hi, if you use file.write and the name of a txt file it will create it if it doesn’t exist usually. Not sure what you’re looking for past that?
@casual_chris_3093
7 ай бұрын
I did the first part and it’s saying no module name pygame
@lemastertech
7 ай бұрын
Hi you need to do pip install Pygame and actually install the module into your project
@jo3thegreat380
2 жыл бұрын
Hello Everyone im up to 25:50 when i click the buttons instead of the bars moving i get the circle and rectangle disappear and nothing happens. pls help this would be much appreciated...
@lemastertech
2 жыл бұрын
Hey sir sounds like you have a problem with your indentation! Make sure your lines of code where you are drawing the objects onto the screen are not indented inside of your loop handling events! If you want to share your code we can help!
@jo3thegreat380
2 жыл бұрын
@@lemastertech i looked at the indentation and it seems everything is fine. how would you like me to send my code
@jo3thegreat380
2 жыл бұрын
@@lemastertech or if you could send me your code up to 25:50 i think episode 2 or 3
@lemastertech
2 жыл бұрын
@@jo3thegreat380 what's a good email for you?
@TheLedgendaryMiner
8 ай бұрын
task1, task2, task3, task4, task5 are giving me error at 23:55
@lemastertech
8 ай бұрын
What does it say the error is??
@TheLedgendaryMiner
8 ай бұрын
@@lemastertech it says task 1-5 are not defined (reportundefinedvariable)
@Ambreenfarahabrazik
Жыл бұрын
Sir it is not showing green circle and rectangle
@lemastertech
Жыл бұрын
Okay if you’re using PyGame.draw.rect just like I do in the video and it isn’t showing up then you might be drawing the objects before the screen.fill function? If it isn’t giving you an error you are probably accidentally drawing something on top of it!
@thisisanormalaccount356
2 жыл бұрын
can u paste the code here pls?
@lemastertech
2 жыл бұрын
Hi I am sorry, I wish I could but the laptop I made this project on died and I didn’t put this project in a GitHub!
@thisisanormalaccount356
2 жыл бұрын
@@lemastertech oh its fine
@mylittleparody2277
2 жыл бұрын
Thank you very much for this tutorial, it's really useful. But... Please, please, separate your game logic from your display! It's way better to add/modify functionalities or display without breaking everything. Copy copy copy... Please, use objects or at least dictionaries. You do say so in your tutorial "It would be cleaner", well, do it then =P "task1, green_length, draw_green" REEEeeee! Make up your mind already! Use "task1, length1, draw1" or "green_task, green_length, green_draw" or green = {"task":None, "length":40, "draw":False} The problem by using 40.000 variables is that it doesn't structure the mind of the learning coders and is a hell to maintain or to add features later on. Make generic functions. The first one I did is: # Draw text def draw_text( coords=(0,0), text="None", color=(255,0,255) ) : textCanvas = font.render( str( text ), True, color ) screen.blit( textCanvas, coords ) If you are interested, here is my version. pastebin.com/MkSYhDuA Obviously it's not perfect either, but maybe it will give you ideas? Also, here are the timestamp. Just put them in the video description and KZitem will automatically add chapters. 0:12 Part1 - Draw the tasks 13:54 Part2 - Execute tasks 28:19 Part3 - Draw more buttons 44:18 Part4 - Finish the game As for the structure of your tutorial, maybe rearrange it. First explain what the game is and what the functions will be. Then, do only one "task" using variable. Then, change it using dictionaries or arrays or objects, and presto, you can add all your "tasks" Then, add the upgrade/manager. It should be easy as everything is separated now. Last, closing remarks and such. Also, maybe talk a bit about code versioning. Even without doing it in the tutorial. It's very important when you learn how to code to also learn how to save it. A very simple zip with timestamp is enough when you start. A commit using git would be even better. I think a commit per chapter is enough as you separated the big functions nicely. Sorry for the wall of text, but your tutorial is really good, and can't help myself but want to help making it even better. I code game for a long time now, but I am new to PyGame, and your tutorial is very nice. Cheers!
@lemastertech
2 жыл бұрын
Hey dude sounds like you’ve got a pretty good foundation in programming! Honestly this was one of my first big pygame tutorials and I don’t always plan it out all ahead of time so I for sure just throw stuff in at points that aren’t necessarily best practices in this one! I’m working on getting better at formatting and consistency and I’ve started adding time stamps to my newer projects as well! Good idea on reviewing revision control, that for sure would be very useful and you’re definitely right this tutorials structure could be improved! Thanks for the feedback and good luck with your projects! I’ll add your time stamps to this one thank you very much for doing that
@mylittleparody2277
2 жыл бұрын
@@lemastertech Hi there! Well, thank you, I have been programming for a while. Yeah, I saw it after that it was an old video, and your new ones are even better! I am doing the beat maker now. It's more mature indeed, and really nice to follow. Revision control is often forgotten (even by academics, at least, "back in my days") but it's really crucial today both for sharing and to ease development. And I was delighted to see that you now have on for the new tutorials! (well, there is still wrk to do in it, like on repo per project/tutorial, but at least, it's here and usable). Glad I could help with timestamps. Thank you again for your tutorials! You definitely need more views!
@lemastertech
2 жыл бұрын
@@mylittleparody2277 Thank you very much for the feedback and I'm glad I've gotten a little smoother in my productions! I just learned this week of the reasons for doing one repo per project so I will be doing that on new projects going forward haha. Thanks again for all the feedback and glad you're enjoying the tutorials! I figure views will come eventually if I just try to focus on quality content! Cheers mate.
Пікірлер: 105