Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » How do I make my coin system collect?
- Likeajumpingpro
-
Scratcher
78 posts
How do I make my coin system collect?
How do I make my coin system collect? I already have a coin system.. Here Is My Game: https://scratch.mit.edu/projects/111582548/#player

I need to make my character collect the coin while I run across the level..
when green flag clicked
ask [For help] and wait for years for an answer

I need to make my character collect the coin while I run across the level..
Last edited by Likeajumpingpro (Dec. 28, 2016 13:56:23)
- duckboycool
-
Scratcher
1000+ posts
How do I make my coin system collect?
I am a bit confused with what you are asking for here, whenever I collect a coin I beat the level. Something you should change is that whenever you press the right arrow to replay the level, you repeatedly fall and can't jump in mid-air like the first time.
- unsightedmetal6
-
Scratcher
500+ posts
How do I make my coin system collect?
I'm confused, too. It seems to work for me…
- tycool1
-
Scratcher
500+ posts
How do I make my coin system collect?
It doesn't seem like you made a script to keep track of the score. You might what to make something that keeps track of it.
- moosmosis
-
Scratcher
11 posts
How do I make my coin system collect?
Hi Likeajumpingpro,
Checking out your project, I see that you have an <Icon Score> variable. Do you want your coin collecting system to increase the Icon Score every time the sprite collects the coin, or is that a separate variable for the number of red spikes that the cat sprite passes? Like tycool1 mentions, if you want to keep track of score based on the number of coins collected, first set a new variable for coin score, for example <Coin Score>. Next, under your <cat> sprite:
Under your coin sprite or clone:
The script above will allow your coin to disapper once the cat touches it and changes your coin score.
I hope this helps! So far, your project looks great - I like your scrolling aspect; your game reminds me of a version of Geometry Dash, except with Scratch the Cat.
Let me know if you have any additional questions.
Checking out your project, I see that you have an <Icon Score> variable. Do you want your coin collecting system to increase the Icon Score every time the sprite collects the coin, or is that a separate variable for the number of red spikes that the cat sprite passes? Like tycool1 mentions, if you want to keep track of score based on the number of coins collected, first set a new variable for coin score, for example <Coin Score>. Next, under your <cat> sprite:
when green flag clicked
set [Coin score v] to [0]
end
Under your coin sprite or clone:
when green flag clicked
forever
if <touching [ cat] ?> then
change [Coin score] by (1)
hide
end
end
end
The script above will allow your coin to disapper once the cat touches it and changes your coin score.
I hope this helps! So far, your project looks great - I like your scrolling aspect; your game reminds me of a version of Geometry Dash, except with Scratch the Cat.
Let me know if you have any additional questions.Last edited by moosmosis (Jan. 2, 2017 04:10:06)
- cs1894620
-
Scratcher
1 post
How do I make my coin system collect?
Heres an example on my coin system
when I receive [ v]
if <[] = [5]> then
change [ v] by (1)
stop [ v]
end
- JAYDEN_____XD
-
Scratcher
6 posts
How do I make my coin system collect?
when green flag clicked
forever
if <> then
<touching [ v] ?>
hide
end
end
- somegrossdays
-
Scratcher
22 posts
How do I make my coin system collect?
your sprite
when green flag clickedcoin's sprite
forever
if <touching [coin v] ?> then
change [coins v] by (1)
broadcast [coin v]
end
end
when I receive [coin v]
hide
- Oumuamua
-
Scratcher
1000+ posts
How do I make my coin system collect?
This topic is more than three years old….
- PersRufaro
-
Scratcher
100+ posts
How do I make my coin system collect?
your spritewhen green flag clickedcoin's sprite
forever
if <touching [coin v] ?> then
change [coins v] by (1)
broadcast [coin v]
end
endwhen I receive [coin v]
hide
when green flag clicked
forever
if <> then
<touching [ v] ?>
hide
end
end
Heres an example on my coin systemPlease don’t necropost. It’s when you post on an old topic and it brings it back to the top of the forum.when I receive [ v]
if <[] = [5]> then
change [ v] by (1)
stop [ v]
end
- FlingYourself
-
Scratcher
6 posts
How do I make my coin system collect?
This topic is more than three years old….well yeah but it helps other people too not just the person who posts
- Vibrato
-
Scratcher
1000+ posts
How do I make my coin system collect?
The person who made the topic most likely doesn't need help with it anymore as the problem is 4 years old.This topic is more than three years old….well yeah but it helps other people too not just the person who posts
Other people can just create their own topic. It's much more likely for someone to get help if they make their own topic.
- joshuaho
-
Scratcher
1000+ posts
How do I make my coin system collect?
That may be true - but there's still a lot of other unanswered topics in this forum that need to be answered. Posting on an old thread brings it to the top of the forum index, which pushes down the other (new) ones that have not yet been resolved. It wouldn't really help other users if the first page was filled with old, random topics that have already been answered.This topic is more than three years old….well yeah but it helps other people too not just the person who posts
If someone needs help, then it would be best for them to create their own topic. That gets multiple users to respond to it - and it's a lot more effective compared to looking at a separate old thread (which is going to get pushed down anyway as new topics come in).

- Discussion Forums
- » Help with Scripts
-
» How do I make my coin system collect?












