Discuss Scratch

ErwinGamesYT
Scratcher
10 posts

How to make a clicker game.

I really want to make a clicker game but I dont know how to code it with upgrades but I know how to make it click and get points. But honestly I might just watch a youtube tutorial. If you guys have any tips just tell me I guess .

Last edited by ErwinGamesYT (Sept. 3, 2020 15:56:30)

mrkeith101
Scratcher
500+ posts

How to make a clicker game.

ok first choose your sprite and make a variable “clicks”

then when the sprite is clicked change clicks by 1

then make another sprite that helps you so lets say +1 clicks per second, but you need to use 50 clicks for it

you can say that when this sprite is clicked, if clicks is greater than 49(the number below it) then forever change clicks by 1 and wait 1 second. else say “not enough clicks”

then repeat this and change it so maybe +5 clicks or +10 clicks or make whatever you want!!

but this is just basic so you can make this harder
ErwinGamesYT
Scratcher
10 posts

How to make a clicker game.

I need some help trying to make an upgrade where it makes your click do 2 dollars every click instead of 1 but I dont know the code for it. I'd be glad if you know how to do that.

Last edited by ErwinGamesYT (Sept. 3, 2020 20:31:09)

ErwinGamesYT
Scratcher
10 posts

How to make a clicker game.

also thanks
mrkeith101
Scratcher
500+ posts

How to make a clicker game.

ok so instead of change clicks by 1

whenclickedsetnumofclicksperclickto1whenthisspriteclickedchangeclicksbynumofclicksperclick

in the upgrade sprite
whenthisspriteclickedifclicks>49thensetnumofclicksperclickto2elsesaynot enough clicks!!for2secs

that way by setting numofclicksperclick to 2 and changing the clicks by this variable, it will change it by 2.
codeman1044
Scratcher
1000+ posts

How to make a clicker game.

Modifying mrkeith101's code:
whenclickedsetnumofclicksperclickto1setpriceto50whenthisspriteclickedchangeclicksbynumofclicksperclick
upgrades:
whenthisspriteclickedifclicks>price-1thensetnumofclicksperclickto2changeclicksby-1*pricechangepriceby50elsesaynot enough clicks!!for2secs
I added a third variable for the price, so each time you purchase the upgrade, it costs more to buy it and uses up some of your clicks. If this was not added, after 50 clicks you could purchase infinite upgrades. The part that takes away your clicks is purely optional, but I feel it would be more interesting.

Last edited by codeman1044 (Sept. 3, 2020 21:08:19)

ErwinGamesYT
Scratcher
10 posts

How to make a clicker game.

OMG thank you so much it works . One thing though, I didnt know how to make it where you press a button to get $3 a click but I made it so if you have $150 you would automatically get the upgrade.

Last edited by ErwinGamesYT (Sept. 3, 2020 23:50:37)

codeman1044
Scratcher
1000+ posts

How to make a clicker game.

That would be my bad. The proper code should look like this:
whenthisspriteclickedifclicks>price-1thenchangenumofclicksperclickby1changeclicksby-1*pricechangepriceby50elsesaynot enough clicks!!for2secs

Powered by DjangoBB