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

#1 2012-04-12 15:42:35

st4282
New Scratcher
Registered: 2012-04-12
Posts: 7

Problem?

How do you decrease the score when a bullet for instance is touching a sprite

Offline

 

#2 2012-04-12 16:23:35

pi3
Scratcher
Registered: 2011-12-31
Posts: 500+

Re: Problem?

Hi st4282, usually when you have a scripting problem, it's best to post under Help with Scripts.

Anyway, on the bullet sprite:

when gf clicked
forever
    if < touching [sprite] >
         change [score] by [-1]
    end
end
You may also want to put a
 hide 
in with the change score block if you want the bullet to disappear after hitting the sprite.  smile


http://i44.tinypic.com/ofdhc4.jpgThanks FreshStudios!

Offline

 

#3 2012-04-12 16:47:52

st4282
New Scratcher
Registered: 2012-04-12
Posts: 7

Re: Problem?

Thanks for moving it and you deserve a higher rating than scratcher.

Offline

 

#4 2012-04-12 16:54:36

TorbyFork234
Scratcher
Registered: 2012-03-01
Posts: 1000+

Re: Problem?

pi3 wrote:

Hi st4282, usually when you have a scripting problem, it's best to post under Help with Scripts.

Anyway, on the bullet sprite:

when gf clicked
forever
    if < touching [sprite] >
         change [score] by [-1]
    end
end
You may also want to put a
 hide 
in with the change score block if you want the bullet to disappear after hitting the sprite.  smile

That wouldn't work all the time because if the bullet is going slowly, it will still be touching the character. A better script is this

when gf clicked
forever
if <touching [main character v]?>
change [score v] by [-1]
wait until <not<touching [main character v]?>>
end

Offline

 

#5 2012-04-12 16:57:07

st4282
New Scratcher
Registered: 2012-04-12
Posts: 7

Re: Problem?

Thanks that is first class thanks, can I add u as a friend?

Offline

 

Board footer