Discuss Scratch

ThyFunniGuy
Scratcher
3 posts

How to make a clicks per second upgrade in a scratch game?

I am trying to make a CPS feature in a clicker game. I am currently using Griffpatch's number counter code for the score, and i tried the “increase clicks by score method.” Like this:
change [cps v] by (1)

change [score v] by (cps)

but when I run this code, the cps is set to nine and the score shoots up way more than nine every second. The index variable for the score is nine, so that has something to do with it. Any help?

Last edited by ThyFunniGuy (Jan. 17, 2025 16:52:23)

jmb1293634
Scratcher
1000+ posts

How to make a clicks per second upgrade in a scratch game?

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it
ThyFunniGuy
Scratcher
3 posts

How to make a clicks per second upgrade in a scratch game?

jmb1293634 wrote:

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it

Okay, i'll tell you how to get to the clicker section. https://scratch.mit.edu/projects/1099576460/

Once you launch it, hover your cursor at the middle-top section of the screen until you see a white box with a question mark. Click that, and there you go.
JLP_THE_GOAT
Scratcher
1 post

How to make a clicks per second upgrade in a scratch game?

i got
no clue so dont ask me
somethingelse0_0
Scratcher
65 posts

How to make a clicks per second upgrade in a scratch game?

Do you mean like if you get 9cps than it is equivalent to 9 clicks per second?
If so, just do something like:
change [add_clicks v] by ((timer) * (cps))
set [Final_clicks v] to (round ((add_clicks) + (clicks)))
and when the button is clicked, then just +1 “clicks”. Use the “Final_clicks” for the actual score. It's not perfect, but that's all I can think of.
Oneshot_Enthusiast
Scratcher
100+ posts

How to make a clicks per second upgrade in a scratch game?

jmb1293634 wrote:

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it

problem with that is that the block

jmb1293634 wrote:

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it

problem with that is that the block
when upgrade::events hat
doesn't exist so

Last edited by Oneshot_Enthusiast (Sept. 9, 2025 11:53:48)

subtostuffwithjames
New Scratcher
1 post

How to make a clicks per second upgrade in a scratch game?

think [] for (2) secs
say [] for (2) secs
Com_engineer_Tom
Scratcher
73 posts

How to make a clicks per second upgrade in a scratch game?

Oneshot_Enthusiast wrote:

jmb1293634 wrote:

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it

problem with that is that the block

jmb1293634 wrote:

try this:
when upgrade::events hat
change [cps v] by (1)
when this sprite clicked
change [score v] by (cps)
if that is what you mean by
change [cps v] by (1)

change [score v] by (cps)
then sorry can you share the project too allow us to test it

problem with that is that the block
when upgrade::events hat
doesn't exist so
I think it is inferred that you should broadcast a message

Powered by DjangoBB