Create an Idle Clicker Adventure Capitalist Style Game in Python Using Pygame! Full Game In An HOUR! -

Create an Idle Clicker Adventure Capitalist Style Game in Python Using Pygame! Full Game In An HOUR!

LeMaster Tech
Views: 1263
Like: 46
Learn to create an idle click style game in the model of the classic and popular adventure capitalist style of app by using python and pygame!
This is the compilation of our full series that covers start to finish how to create this entire game from scratch! We cover the basics of python and pygame code creation while also diving into more advanced programming concepts in this series!

Episode 1 covers the basics of defining the board game space, as well as importing the module, defining screen dimensions and creating a library of colors. Additionally we create a function to draw the tasks onto the screen rather than defining each individually. We then cover conditions for exiting out of the game as well as displaying text for the value of each event onto the buttons.

Episode 2 in the series handles the actions from the player of actually clicking on each button and updating the money or score the player has accumulated so far! This includes getting the position of the mouse upon clicking and checking if the coordinates are aligned with any of the defined event buttons.

Episode 3 includes the drawing of the buttons for purchasing more of each event commodity and displaying the manager buttons that would allow the player to automate each task. Additionally we block transfer (blit) text onto the screen showing the cost of each element and round all numerical value to only two decimal places.

Episode 4 concludes the series by handling the actual purchase and automation of each task when the managers are purchased, as well as increasing the value of each event and the cost of purchasing more of each event.

Thanks for checking the video out and be sure to be on the look out for more great content and check out the channel for dozens of useful python tutorials like this!

Be sure to like, subscribe, and leave a comment on what you found useful or what you’d like to see next!


  1. I did the first part and it’s saying no module name pygame

  2. Ive got a problem. my problem is when I run the game the window doesnt pop up 6:07

  3. 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?

  4. task1, task2, task3, task4, task5 are giving me error at 23:55

  5. what if this was on a document that i may be able to copy and paste so i can play it…

  6. 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!)

  7. 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.

  8. How do I add a txt folder it says that it didn’t exist

  9. 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.

  10. You've probably addressed this a thousand times, but what Python editor are you using?

  11. 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!

  12. Thanks for the tutorial. I'm gonna try and refactor that mess in order to learn how to do that.

  13. Sir it is not showing green circle and rectangle

  14. 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.

  15. 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

  16. Thanks, man 🙂 First idle clicker game I created because of your help.

  17. 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!

  18. broyou 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 gamethanks :))

  19. can u paste the code here pls?

  20. 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)

  21. 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

  22. thank you so much! ive been wanting learn python for months and this video rly helped!

  23. 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 textdef 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. 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 Youtube will automatically add chapters.0:12 Part1 – Draw the tasks13:54 Part2 – Execute tasks28:19 Part3 – Draw more buttons44:18 Part4 – Finish the gameAs 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!

  24. 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.

  25. 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!!!!

  26. Brilliant! TYSM 👏 now going to play around to add more features I.e. multi buy, achievement messages and then icons too 😬😁

  27. hi, nice job! any chance for sharing the code?

  28. 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…

  29. 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

  30. where do you write this code? i downloaded Python and Pygame but neither pull up this editor

  31. 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.

  32. 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?

Leave a Reply

Your email address will not be published.