Discuss Scratch

FelixJaphy
Scratcher
10 posts

clicker upgrades

I'm making a clicker game and I'm having trouble with the upgrades (cookie clicker style). I'm trying to make it so that when a sprite is touching 2 or more different sprites, it will stop moving, but will restart when one of the sprites isn't working. The thing im trying right now is
whenIreceiveforeveriftouching?thenrepeatuntilnottouching?move5stepsmove-5steps
and the other thing i have is
whenIreceiveforeverifnottouching?thenmove-5steps
this is complicated and if anyone can help please do.
if i figure it out on my own i will say so

Last edited by FelixJaphy (Oct. 3, 2022 15:31:51)

tiaza
Scratcher
500+ posts

clicker upgrades

FelixJaphy wrote:

I'm making a clicker game and I'm having trouble with the upgrades (cookie clicker style). I'm trying to make it so that when a sprite is touching 2 or more different sprites, it will stop moving, but will restart when one of the sprites isn't working. The thing im trying right now is
whenIreceiveforeveriftouching?thenrepeatuntilnottouching?move5stepsmove-5steps
and the other thing i have is
whenIreceiveforeverifnottouching?thenmove-5steps
this is complicated and if anyone can help please do.
if i figure it out on my own i will say so
Hi! I don't exactly understand what you mean, could you send a link? I made a clicker game too maybe you find the solution there: https://scratch.mit.edu/projects/728285459/
Or try this:
broadcastwhenIreceiveforeveriftouching?thenmove-5stepselsemove5steps
Or
whenIreceiveforeverifmousedown?thenmove-5steps
I hope I could've helped you, if not just please send a link to your game and I'll try to solve your problem

Last edited by tiaza (Oct. 4, 2022 08:55:00)

FelixJaphy
Scratcher
10 posts

clicker upgrades

tiaza wrote:

FelixJaphy wrote:

I'm making a clicker game and I'm having trouble with the upgrades (cookie clicker style). I'm trying to make it so that when a sprite is touching 2 or more different sprites, it will stop moving, but will restart when one of the sprites isn't working. The thing im trying right now is
whenIreceiveforeveriftouching?thenrepeatuntilnottouching?move5stepsmove-5steps
and the other thing i have is
whenIreceiveforeverifnottouching?thenmove-5steps
this is complicated and if anyone can help please do.
if i figure it out on my own i will say so
Hi! I don't exactly understand what you mean, could you send a link? I made a clicker game too maybe you find the solution there: https://scratch.mit.edu/projects/728285459/
Or try this:
broadcastwhenIreceiveforeveriftouching?thenmove-5stepselsemove5steps
Or
whenIreceiveforeverifmousedown?thenmove-5steps
I hope I could've helped you, if not just please send a link to your game and I'll try to solve your problem
I tried what you said and it kind of worked, but i had already done something like that and it had the same result. The link to the game is https://scratch.mit.edu/projects/724230965 and im trying to make cookie clicker style upgrades
If i do that, it goes forwards 1 and then goes back and touches the thing again, so it flickers back and forth.

Last edited by FelixJaphy (Oct. 5, 2022 14:12:12)

tiaza
Scratcher
500+ posts

clicker upgrades

So if it goes back and forth maybe put a
forevergotox:herenumbery:herenumber
(If you don't need it for anything else)

Last edited by tiaza (Oct. 5, 2022 17:17:32)

deck26
Scratcher
1000+ posts

clicker upgrades

tiaza wrote:

So if it goes back and forth maybe put a
forevergotox:y:0
(If you don't need it for anything else)
Not a sensible idea. If a sprite is moving and you want it to stay still deal with the code that is moving it. If you move it back to 0,0 in a forever loop and another script is moving it you're not controlling the order in which these happen within a frame so all you can be sure of is that you're not allowing multiple moves to accumulate.
tiaza
Scratcher
500+ posts

clicker upgrades

deck26 wrote:

tiaza wrote:

So if it goes back and forth maybe put a
forevergotox:y:0
(If you don't need it for anything else)
Not a sensible idea. If a sprite is moving and you want it to stay still deal with the code that is moving it. If you move it back to 0,0 in a forever loop and another script is moving it you're not controlling the order in which these happen within a frame so all you can be sure of is that you're not allowing multiple moves to accumulate.
I know it's probably not the best idea, but I haven't got one better
BrSquad
Scratcher
1 post

clicker upgrades

whenclickedswitchcostumetoapple-agotofrontsetsizeto100%gotox:0y:0foreverifkeyright arrowpressed?thenchangexby10

Last edited by BrSquad (Oct. 5, 2022 17:56:05)

FelixJaphy
Scratcher
10 posts

clicker upgrades

I just thought of an idea where i put invisible pegs between where the upgrades go and somehow teleport them to the next peg when no upgrade is there. If anyone finds out how to do this before i do, please say so.
XxGamingAmazingxX
Scratcher
3 posts

clicker upgrades

Hello fellow scratchers!

I have this promblem on my clicker game kinda related to cookie clicker but the only promblem is when buying a item apon the scratchers request im trying to make it multiply like cookie clicker when you first buy a cursor it clicks for you but slowly and times it the more you buy, can anyone help me i feel so confused.
Thanks!
FelixJaphy
Scratcher
10 posts

clicker upgrades

XxGamingAmazingxX wrote:

Hello fellow scratchers!

I have this promblem on my clicker game kinda related to cookie clicker but the only promblem is when buying a item apon the scratchers request im trying to make it multiply like cookie clicker when you first buy a cursor it clicks for you but slowly and times it the more you buy, can anyone help me i feel so confused.
Thanks!
why are you here this was posted over a year ago

Powered by DjangoBB