
Create an Idle Clicker Adventure Capitalist Style Game in Python Using Pygame! Full Game In An HOUR!
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!
Thanks!
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!
Thanks for the tutorial. I'm gonna try and refactor that mess in order to learn how to do that.
Sir it is not showing green circle and rectangle
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.
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
Thanks, man 🙂 First idle clicker game I created because of your help.
thanks:)
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!
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 :))
can u paste the code here pls?
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)
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
thank you so much! ive been wanting learn python for months and this video rly helped!
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.https://pastebin.com/MkSYhDuAObviously 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!
Thanks this was awesome and easy to follow.
this good
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.
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!!!!
Brilliant! TYSM 👏 now going to play around to add more features I.e. multi buy, achievement messages and then icons too 😬😁
hi, nice job! any chance for sharing the code?
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…
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
where do you write this code? i downloaded Python and Pygame but neither pull up this editor
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.
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?