Discuss Scratch

Epic_Blue_Cat6412
Scratcher
36 posts

x2 clicks upgrade?

So I'm making a clicker game, and it costs 100 clicks to get x2 clicks. How do I code the x2 clicks? (its not clicks per second, whenever you click the cake you get 1 click.) My question is how do I make the script that is used for 1 click stop when i get the x2 multiplier?
_turtle64
Scratcher
100+ posts

x2 clicks upgrade?

Instead of the clicks having a set value, have their value be a variable, like this:

when this sprite clicked
change [points v] by (clicks)

That way, you can change the value of the “clicks” variable to increase the amount of points that the player gets when the sprite is clicked. In your case, you want to double it, so you can just do this:

change [clicks v] by ((clicks) * (2))
Epic_Blue_Cat6412
Scratcher
36 posts

x2 clicks upgrade?

_turtle64 wrote:

Instead of the clicks having a set value, have their value be a variable, like this:

when this sprite clicked
change [points v] by (clicks)

That way, you can change the value of the “clicks” variable to increase the amount of points that the player gets when the sprite is clicked. In your case, you want to double it, so you can just do this:

change [clicks v] by ((clicks) * (2))
The way that works, it constantly doubles it. What I'm trying to do is make it so that when you click it, it gives you 2 clicks instead of one. But the part I'm really stuck on is how I make the script that increases it by 1 stop and instead increase by 2.

Last edited by Epic_Blue_Cat6412 (Jan. 19, 2024 02:22:45)

_turtle64
Scratcher
100+ posts

x2 clicks upgrade?


Epic_Blue_Cat6412 wrote:

_turtle64 wrote:

Instead of the clicks having a set value, have their value be a variable, like this:

when this sprite clicked
change [points v] by (clicks)

That way, you can change the value of the “clicks” variable to increase the amount of points that the player gets when the sprite is clicked. In your case, you want to double it, so you can just do this:

change [clicks v] by ((clicks) * (2))
The way that works, it constantly doubles it. What I'm trying to do is make it so that when you click it, it gives you 2 clicks instead of one. But the part I'm really stuck on is how I make the script that increases it by 1 stop and instead increase by 2.
Sorry for the misunderstanding. You can just remove the multiplier.
change [clicks v] by [whatever value you want]
On each click, the points will increase by whatever the value of the “clicks” variable is.
The “clicks” variable will be set to one at the start, only providing one point per click. When you upgrade it, the “clicks” variable's value will change, providing more points per click.

Please tell me if im not understanding something.
Epic_Blue_Cat6412
Scratcher
36 posts

x2 clicks upgrade?

_turtle64 wrote:

Epic_Blue_Cat6412 wrote:

_turtle64 wrote:

Instead of the clicks having a set value, have their value be a variable, like this:

when this sprite clicked
change [points v] by (clicks)

That way, you can change the value of the “clicks” variable to increase the amount of points that the player gets when the sprite is clicked. In your case, you want to double it, so you can just do this:

change [clicks v] by ((clicks) * (2))
The way that works, it constantly doubles it. What I'm trying to do is make it so that when you click it, it gives you 2 clicks instead of one. But the part I'm really stuck on is how I make the script that increases it by 1 stop and instead increase by 2.
Sorry for the misunderstanding. You can just remove the multiplier.
change [clicks v] by [whatever value you want]
On each click, the points will increase by whatever the value of the “clicks” variable is.
The “clicks” variable will be set to one at the start, only providing one point per click. When you upgrade it, the “clicks” variable's value will change, providing more points per click.

Please tell me if im not understanding something.
So, I have a message that is broadcast when you buy the upgrade. I'm still confused in a way. What script should I use so that I can change the value of the clicks to 2 when I receive that message? If possible, I would like the full script please.
_turtle64
Scratcher
100+ posts

x2 clicks upgrade?

I changed the “clicks” variable name to “click power”, hopefully that conveys it better
when I receive [upgrade bought v]
change [click power v] by [...]//amount of click power you want the purchase to add
Then, in the cake sprite, you can put this script:
when this sprite clicked
change [points v] by (click power)
Whenever the cake is clicked, the points will increase by whatever the click power is. This means that you can increase the points per click by increasing the value of the click power variable. The click power variable's value will be increased once the purchase is made.

Sorry for any confusion I made, hope this clears it up.
Epic_Blue_Cat6412
Scratcher
36 posts

x2 clicks upgrade?

_turtle64 wrote:

I changed the “clicks” variable name to “click power”, hopefully that conveys it better
when I receive [upgrade bought v]
change [click power v] by [...]//amount of click power you want the purchase to add
Then, in the cake sprite, you can put this script:
when this sprite clicked
change [points v] by (click power)
Whenever the cake is clicked, the points will increase by whatever the click power is. This means that you can increase the points per click by increasing the value of the click power variable. The click power variable's value will be increased once the purchase is made.

Sorry for any confusion I made, hope this clears it up.
ty so much, here's the completed game! https://scratch.mit.edu/projects/952750608/
(it wasn't a cake i kinda just put a random thing there lol)
TheUltimateHoodie
Scratcher
1000+ posts

x2 clicks upgrade?

Epic_Blue_Cat6412 wrote:

So I'm making a clicker game, and it costs 100 clicks to get x2 clicks. How do I code the x2 clicks? (its not clicks per second, whenever you click the cake you get 1 click.) My question is how do I make the script that is used for 1 click stop when i get the x2 multiplier?
when this sprite clicked
change [clicks v] by (click multiplier)


when I receive [upgrade clicks v]
set [click multiplier v] to [2]

Last edited by TheUltimateHoodie (Jan. 19, 2024 06:24:34)

branrat24
New Scratcher
1 post

x2 clicks upgrade?

How did you get the upgrade clicks in to the when i receive block
bbhcoolest
Scratcher
3 posts

x2 clicks upgrade?

??? you just attach it like a normal block.

Powered by DjangoBB