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

#1 2012-05-26 07:56:34

uhsting
New Scratcher
Registered: 2012-05-26
Posts: 4

Help with sensing and scoring!

Help with my latest project on sensing and scoring!

When I command my sprite to glide to an object and once it touches it, it will score 1 mark. However, I don't know how to make this 1 mark. It either gets 1 mark continuously or no mark! HELP!!!

The either two scripts that I've made:

when gf clicked
if <color [orange] is touching [olive]>?
broadcast [good v]
end
Then,

when i receive [good v]
play sound [pop v]
change [score v] by [1]
change [total score v] by [1]
Another:
when gf clicked
forever
repeat [1]
if <color [orange] is touching [olive]>?
change [score v] by [1]
change [total score v] by [1]
end
end

Offline

 

#2 2012-05-26 08:08:20

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: Help with sensing and scoring!

First off you don't need that repeat. But anyway if you have one sprite that needs to touch "olive" then just have a script in the touching one to say:

when gf clicked
forever
if <touching [olive v]?>
play sound [pop v]
change [score v] by (1)
change [total score v] by (1)
wait until <not <touching [olive v]?>>
if it's a lot of sprites then you dupe the script


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-05-29 09:25:45

uhsting
New Scratcher
Registered: 2012-05-26
Posts: 4

Re: Help with sensing and scoring!

It seems that it can only to one sprite! What happened!

Offline

 

#4 2012-05-29 09:35:43

uhsting
New Scratcher
Registered: 2012-05-26
Posts: 4

Re: Help with sensing and scoring!

Oh, I fixed the problem. It was a false alarm and thanks to your script!

Offline

 

Board footer