Ask coding questions

← Back to all posts
can any one help me import a clicker game method to this new code
objectme12 (39)

i want to know how to make a clikcer game so can anyone help me

Answered by SUHASTADIPARTH1 (174) [earned 5 cycles]
View Answer
Commentshotnewtop
SUHASTADIPARTH1 (174)

Do you mean like in the console?

objectme12 (39)

@SUHASTADIPARTH1 yeah like it shows up all the players gold and stuff like that

SUHASTADIPARTH1 (174)

@objectme12 You can do it in the python console by doing

clicks = 0

while True:
click = input("Press enter: ")
clicks += 1
print(clicks)

SUHASTADIPARTH1 (174)

@objectme12 Yes, You can do it in the python console.

SUHASTADIPARTH1 (174)

@objectme12 Did you see the python code I posted?

SUHASTADIPARTH1 (174)

@objectme12 That's how you can do it in the python console.

SUHASTADIPARTH1 (174)

@objectme12 Please mark my answer if it helps. Thank you.

JBYT27 (1150)

You might want to add an indentation after the while True: statement. like this:
while True:
click = input("Press enter: ")
clicks += 1
print(clicks)
@objectme12
EDIT: it doesn't seem to work, the indenting...

JBYT27 (1150)

Add two spaces before the input. Then do the same with the other 2 lines @objectme12

SUHASTADIPARTH1 (174)

@objectme12 This is how your code should look like:


SUHASTADIPARTH1 (174)

@objectme12 and then run the repl and press enter and see it in action.

objectme12 (39)

ok but now i want to add something to where i can collect more [email protected]

SUHASTADIPARTH1 (174)

@objectme12. Please explain a bit more. Do you want a shop where people can buy stuff in the console?

SUHASTADIPARTH1 (174)

@objectme12 Ok. I will show the code. Please give a few minutes.

SUHASTADIPARTH1 (174)

@objectme12 Hi. I finally have the code. Sorry it took so long. I was away for a while. But I finally have it. Just go to my account, and go to my shop repl. which is after the folders section.

If you want to add more items to you shop, just add the item name and it's price in the shop dictionary. And the rest would be up to.

SUHASTADIPARTH1 (174)

@objectme12 Feel free to fork if you would like to :)

Bookie0 (4977)

Hi!
if you want to make a clicker game, you should probably use HTML CSS JS. here are some tutorials, if you're new to the language:

https://www.w3schools.com/

https://www.w3schools.com/html/html_scripts.asp

https://www.w3schools.com/js/

https://www.coursera.org/learn/html-css-javascript-for-web-developers

https://blog.hubspot.com/marketing/web-design-html-css-javascript

https://www.codecademy.com/catalog/language/html-css

https://medium.com/thebit/top-10-project-based-tutorials-for-learning-html-css-javascript-25f361aadd0

To make a clicker game, check out these websites:

https://dev.to/bastionthedev/learning-with-clicker-games-part-1-html-1i4b

https://code.sololearn.com/WzhK2lJ9L3Q6/

https://www.xspdf.com/resolution/51004049.html

https://codepen.io/samuelbeard/pen/Dsdie

Basically, you'll want a button, or an object acting like a button on the screen. Next, whenever a user clicks on it, you'll want a variable (that is at first 0) to increment (add 1). So each time they click, the variable will be bigger by 1. Add CSS to make the whole webpage look nicer, with colors, layouts, fonts, images, etc. You can also add a shop option where you can get "clickers" to click for you, like it clicks automatically every 10 seconds. It's all up to you.

Check out cookie clicker here to see how they do their clicker.

Good luck! ;)