This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2012-11-17 12:57:58

MrBob9786
New Scratcher
Registered: 2012-11-09
Posts: 5

Help with score problem/gltich

In my game, a sprite is supposed to touch another sprite and when it does that, it should increase the score.

This is my script for sprite 1:

when gf clicked
set [score v] to 0
forever if <touching sprite2>
change [score v] by 1
end
When I play my game, the score does not work. Can anyone please tell me if there is anything wrong with this script? Also if there is something wrong with it then can someone give me a replacement script? Thank you for all the help.

Offline

 

#2 2012-11-17 13:08:12

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help with score problem/gltich

MrBob9786 wrote:

In my game, a sprite is supposed to touch another sprite and when it does that, it should increase the score.

This is my script for sprite 1:

when gf clicked
set [score v] to (0)
forever if <touching [sprite2 v]?>
change [score v] by (1)
When I play my game, the score does not work. Can anyone please tell me if there is anything wrong with this script? Also if there is something wrong with it then can someone give me a replacement script? Thank you for all the help.

Fixed.

Anyway, one problem I see is that your score is increasing by huge amounts, correct? Well then, to fix that you might want to add this block into your script after the [change score by 1] block:

wait until <not (touching [sprite2 v]?)>
I hope that this helps!

Last edited by ErnieParke (2012-11-17 13:08:35)


http://i46.tinypic.com/35ismmc.png

Offline

 

#3 2012-11-17 15:03:02

MrBob9786
New Scratcher
Registered: 2012-11-09
Posts: 5

Re: Help with score problem/gltich

Hello,
I tried this out and it worked more often, but occasionally it did not change the score.  Any other suggestions for the issue?
Thanks for your help!

Offline

 

Board footer