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

#1 2012-12-10 15:21:18

sharon888
New Scratcher
Registered: 2012-12-08
Posts: 2

Keeping score when a sprite touches another sprite

I want my variable FISH to go up 1 when a fish sprite touches another sprite.  But I only want the score to go up 1 and it is going up about 20 because that is how long it takes for the fish to pass over the other sprite.  I thought I could solve it by having the score go up .05 but the variable now has decimals in it rather than rounding so that didn't work.  Any suggestions?

Offline

 

#2 2012-12-10 15:37:44

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Keeping score when a sprite touches another sprite

when gf clicked
forever if <touching [sprite 1 v]?>
change [score v] by [1]
wait until <not<touching [sprite 1 v]?>>
Would this work for you?

Last edited by Prestige (2012-12-10 15:38:09)


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#3 2012-12-10 16:23:56

sharon888
New Scratcher
Registered: 2012-12-08
Posts: 2

Re: Keeping score when a sprite touches another sprite

Excellent!  That does it.

Offline

 

#4 2012-12-19 21:48:48

maxamillion321
Scratcher
Registered: 2011-06-17
Posts: 500+

Re: Keeping score when a sprite touches another sprite

What about this?

when gf clicked
if <touching [sprite 1 v]?>
change [score v] by [1]
end

Last edited by maxamillion321 (2012-12-19 21:48:57)

Offline

 

#5 2012-12-21 06:24:49

Ranjeet675
New Scratcher
Registered: 2012-05-08
Posts: 1

Re: Keeping score when a sprite touches another sprite

Thanks a lot "Prestige" that script really helped

I'm doing a health version so i had to do change score by -1

Offline

 

Board footer