Discuss Scratch

WORLDWALKERS
Scratcher
3 posts

Upgrading per click in a clicker game

Hi guys,

While making my clicker game I know how to make the clicks per second thing, but I can't seem to figure out to change upgrade any “Per click”. Like if you upgrade it you get more then just 1 per click. Can anyone please help me?

-Worldwalkers
PhiPhenomenon
Scratcher
500+ posts

Upgrading per click in a clicker game

What does the script you have currently look like? Could you share the project?
pika_boo
Scratcher
100+ posts

Upgrading per click in a clicker game

To add click power:

- make a new variable for click power
- make upgrades increase the variable
- then when you click you simply change your points by the click power
If that's not what you need, maybe share a link to the project so I could more clearly understand what you mean?

Hope that helps

Last edited by pika_boo (Jan. 4, 2024 08:21:35)

WORLDWALKERS
Scratcher
3 posts

Upgrading per click in a clicker game

pika_boo wrote:

To add click power:

- make a new variable for click power
- make upgrades increase the variable
- then when you click you simply change your points by the click power
If that's not what you need, maybe share a link to the project so I could more clearly understand what you mean?

Hope that helps


Can you like maybe explain it with blocks because making the upgrade actually change the click power rate for click is the part I am stuck on.
PhiPhenomenon
Scratcher
500+ posts

Upgrading per click in a clicker game

WORLDWALKERS wrote:

Can you like maybe explain it with blocks because making the upgrade actually change the click power rate for click is the part I am stuck on.
I assume you would have a button that increases click power.

First, inside the button sprite, you would use this code:
whenclickedsetclickPowerto1foreveriftouchingmouse-pointer?andmousedown?thenchangeclickPowerby1

Then inside whatever you're clicking to gain points, use this code:
whenclickedsetclicksto0foreveriftouchingmouse-pointer?andmousedown?thenchangeclicksbyclickPower
JoeyjJoe
Scratcher
100+ posts

Upgrading per click in a clicker game

Please make your own thread instead of commenting on a pre-existing one. Anyways, you might accidentally be using the
set CPSvto1
instead of
changeCPSby1
My_Peeps07073
Scratcher
100+ posts

Upgrading per click in a clicker game

PhiPhenomenon wrote:

Then inside whatever you're clicking to gain points, use this code:
whenclickedsetclicksto0foreveriftouchingmouse-pointer?andmousedown?thenchangeclicksbyclickPower

You see, the problem with that is you can just hold down the thing that you are clicking on, and it will seem like you are clicking at the speed of frame rate. A solution is to use the when this sprite clicked event:
whenclickedsetclicksto0

whenthisspriteclickedchangeclicksbyclickPower
100blacktak
Scratcher
95 posts

Upgrading per click in a clicker game

Simply make the amount you are increasing by higher. Instead of change clicks at one change it to two or if you want
whengreenflagclickedscoresetto0whenthisspriteclickedchangeby1ifscore>10thenchangeby10end

Last edited by 100blacktak (Feb. 17, 2024 06:05:39)

Powered by DjangoBB