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

#1 2011-11-16 13:25:58

133232tdt
New Scratcher
Registered: 2011-11-16
Posts: 1

variable won't change by 1 when characters hit the sprite that changes

I tell the sprite:<when green flag clicked><if><touching[sprite] <change{ x }by(1) But it doesn't work

Offline

 

#2 2011-11-16 15:37:39

TRocket
Scratcher
Registered: 2009-08-18
Posts: 1000+

Re: variable won't change by 1 when characters hit the sprite that changes

i think you want the script:
[blocks]
<when green flag clicked>
<forever>
<if><touching[ sprite]>
<change{ x }by( 1)>
<end>
<end>
[/blocks]

Last edited by TRocket (2011-11-16 15:38:35)


http://i.imgur.com/1QqnHxQ.png

Offline

 

#3 2011-11-16 16:22:02

RedRocker227
Scratcher
Registered: 2011-10-26
Posts: 1000+

Re: variable won't change by 1 when characters hit the sprite that changes

Unless you put a forever around the if block, then it will only change the variable by 1 if it's touching the sprite when the game starts.  smile


Why

Offline

 

Board footer