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

#1 2012-01-08 02:00:13

sc_canuck
New Scratcher
Registered: 2012-01-07
Posts: 3

How to do if statements in order?

Hey,
I need to be able to have my program do if else statements, in order. So, I would like it to go through, do the first thing once the condition is met, then, I want it to do the second thing once the condition is met, but not to do the first thing again. But here's the catch, the if statements are all the same. I am using variables and their value is changing.  So, that creates a bunch of problems.
Help is super appreciated

Thanks ALOT!!!!

Offline

 

#2 2012-01-08 08:37:52

Kileymeister
Scratcher
Registered: 2008-04-17
Posts: 1000+

Re: How to do if statements in order?

Now I'm not entirely sure what you want, but this is my best guess:
http://img72.imageshack.us/img72/6850/script.gif

This script runs all three if/elses the first time around, then it doesn't run the first one, then it doesn't run the first or second, then it stops.

EDIT:  Actually, you probably need this:
http://img710.imageshack.us/img710/2220/scriptv.gif
this one runs ONLY the first one the first time around, then ONLY the second one the second time around, and so on.

Last edited by Kileymeister (2012-01-08 08:40:46)


I'm back, and showcasing two new* projects!  Click left or right on the image below to see!
http://img109.imageshack.us/img109/7905/part1l.pnghttp://img859.imageshack.us/img859/6417/part2bf.png

Offline

 

#3 2012-01-08 08:38:14

ImagineIt
Scratcher
Registered: 2011-02-28
Posts: 1000+

Re: How to do if statements in order?

So, you are saying that once both things are done, it will stop doing both? Then, you can use variables like this:

http://postimage.org/image/fapmzs03n/

You can change the conditions and the outputs, but don't change anything with the variable.

Offline

 

Board footer