Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » I need help doing the falling cookies like in cookie clicker on my clicker game
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Hi! I need help making a clone script that spawns a new ghost clone in the background. Here is the my game: https://scratch.mit.edu/projects/872050801
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Your second
I've also noticed that you have a forever loop inside a forever loop. I assume this was a mistake, and you had forgotten you were already in a forever loop, so make sure to take that out because it will cause problems too.
Let me know if you still have any problems, I'll be happy to help!
script isn't working because you've placed
inside of it. The “until done” part means that Scratch will wait for the sound to finish playing before it continues with the script. I suggest moving this to a new
script, possibly within an entirely new sprite as well.
I've also noticed that you have a forever loop inside a forever loop. I assume this was a mistake, and you had forgotten you were already in a forever loop, so make sure to take that out because it will cause problems too.
Let me know if you still have any problems, I'll be happy to help!
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Ok thxs i'll try that
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Your secondscript isn't working because you've placedinside of it. The “until done” part means that Scratch will wait for the sound to finish playing before it continues with the script. I suggest moving this to a newscript, possibly within an entirely new sprite as well.
I've also noticed that you have a forever loop inside a forever loop. I assume this was a mistake, and you had forgotten you were already in a forever loop, so make sure to take that out because it will cause problems too.
Let me know if you still have any problems, I'll be happy to help!
It still doesn't work
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Would you mind writing a script that works? You don't have to
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Firstly, the leftmost green flag script looks to be doing the same thing the other one does, so it can be thrown out. This will also put your coin back into the middle of the screen where I assume you meant for it to go.
Next, I'm noticing that your
Hopefully that all makes sense?
Also, real quick now that I've noticed it, under the “when I start as a clone” you should use
Next, I'm noticing that your
is also preventing Scratch from continuing to run the rest of the code. I suggest replacing this segment of code
with this
Because using wait blocks can interfere with the rest of the code, we can't use them to make sure each frame of the animation displays. Instead, we will let the loop finish, so the frame displays, then come back to finish the animation when we loop back around again.
Hopefully that all makes sense?
Also, real quick now that I've noticed it, under the “when I start as a clone” you should use
instead of the “go to random position” block so that the coins always start at the top of the screen. I use the y value 159 instead of 180 (the highest pixel in Scratch's stage) so that the coins aren't cut off the top of the screen when they start off.
Last edited by BigEmster (Oct. 12, 2023 03:05:15)
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Can you remix it and have the code done? Pls I don't rlly understand that
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Here is the project link.
I think it makes more sense to teach you to do this than to just do it for you, that way you know how it works and can use it again later. You've asked me to do it for you, so I did, but don't hesitate to ask any questions about how it works!
I think it makes more sense to teach you to do this than to just do it for you, that way you know how it works and can use it again later. You've asked me to do it for you, so I did, but don't hesitate to ask any questions about how it works!
- NhitMit2012
-
28 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
For the
block, you could just replace it with a “start sound” block.
block, you could just replace it with a “start sound” block.
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
(#9)Lol, that wouldn't work because it's in a forever loop. The sound would be constantly restarting and interrupting itself.
For the
block, you could just replace it with a “start sound” block.
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Here is the project link.
I think it makes more sense to teach you to do this than to just do it for you, that way you know how it works and can use it again later. You've asked me to do it for you, so I did, but don't hesitate to ask any questions about how it works!
Well I could but thxs for helping if I have any issues I will ask again!
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Can you make it so that it doesn't overlap and it doesn't go behind the upgrades? Also my user is @matt4kj not @matt5kj
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
I changed the project, is this what you wanted?
- matt4kj
-
76 posts
I need help doing the falling cookies like in cookie clicker on my clicker game
Ok ill have a look thxs
- BigEmster
-
100+ posts
I need help doing the falling cookies like in cookie clicker on my clicker game
np
- Discussion Forums
- » Help with Scripts
-
» I need help doing the falling cookies like in cookie clicker on my clicker game