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

#1 2012-11-12 17:26:11

joshamunga
New Scratcher
Registered: 2012-10-29
Posts: 5

Variable changing problem!

So what I have so far:

when gf clicked
set <Life> to 3
forever if <touching Sprite1>
change <Life> by -1
But when the script happens, it makes the life change a lot more than I want it to. What I want it to do is I want it to do is to change the life by negative 1 each time it touches it!

How do you do that?

Joshamunga

Offline

 

#2 2012-11-12 17:29:23

joshamunga
New Scratcher
Registered: 2012-10-29
Posts: 5

Re: Variable changing problem!

Never mind I fixed it with this (just in case someone else needs help with this issue:

when gf clicked
set <Life> to 3
forever if <touching Sprite1>
change <Life> by -1
wait 1 secs

Offline

 

#3 2012-11-12 19:18:22

nama
Scratcher
Registered: 2010-06-06
Posts: 1000+

Re: Variable changing problem!

I think a better fix would be to replace "wait 1 secs" with "wait until not touching sprite 1"


You say goodbye to 1.4, I say hello to 2.0.

Offline

 

#4 2012-11-13 01:23:37

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: Variable changing problem!

joshamunga wrote:

Never mind I fixed it with this (just in case someone else needs help with this issue:

when gf clicked
set [Life v] to [3]
forever if <touching [Sprite1 v]?>
change [Life v] by (-1)
wait until <not <touching [Sprite 1 v]?>>

Scratch blocks fixed and improved.


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

Board footer