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

#1 2010-09-26 14:53:32

tchan5158
New Scratcher
Registered: 2010-09-19
Posts: 25

Life Subtraction

Hello  big_smile

I'm having a bit of trouble with subtracting my [lifes] variable by 1 just ONCE if the Bomb sprite touches the Blue Sprite.

Right now it keeps subtracting the score very fast like up to -100 by the time the Bomb sprite explodes and disappears  sad

[blocks]
<when green flag clicked>
<set{ lifes }to( 4)
<switch to costume[ 1]
<forever if><key[ space ]pressed?>
<show>
<repeat until><touching[ Blue]
<change y by( -5)
<if><touching[ Blue]
<switch to costume[ 2]
<wait( 1 )secs>
<hide>

Offline

 

#2 2010-09-26 15:01:41

SSBBM
Scratcher
Registered: 2009-10-09
Posts: 100+

Re: Life Subtraction

I get confused with forum blocks, but would this work?

http://img683.imageshack.us/img683/70/scriptfortchan5158.gif

Last edited by SSBBM (2010-09-26 15:01:50)


http://goo.gl/zVfAp http://goo.gl/laci8

Offline

 

#3 2010-09-26 15:05:08

tchan5158
New Scratcher
Registered: 2010-09-19
Posts: 25

Re: Life Subtraction

and 2nd part is :
[blocks]
<when green flag clicked>
<forever>
<if><touching[ blue]
<change{lifes  }by( -1)

Offline

 

Board footer