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

#1 2013-01-11 15:00:13

aaronsg
New Scratcher
Registered: 2013-01-11
Posts: 2

quick questions

hi i am new to scratch have been using it for a few hours and getting the hang on it. interacting with other sprites, moving sprites with arrow keys.
for a project i need to include ' use at least one condition, one loop, and one variable '
i have done the variable which is using the arrow keys, change x by -25. but  what does it mean to loop or the definition of a condition.
i would take a guess and say using the REPEAT UNTIL function is a condition?

finally in conversing with sprites how do you stop the speech bubble appearing in one of them as when sprite 1 touches sprite 2, sprite 2 starts talking but sprite 1s speech bubble is still present, ive tried attaching stop script but that has not worked

when gf clicked
if  [touching sprite 2]
stop script
end
any suggestions?

have to say i am having fun using scratch i understand so much how some games like pacman have been made, its so cool

Offline

 

#2 2013-01-11 16:27:36

amcerbu
Scratcher
Registered: 2009-07-21
Posts: 500+

Re: quick questions

A condition refers to an "if" clause.  The code inside the bracket is executed if the condition is true.  For example:

when gf clicked
set [RandomNumber v] to (pick random (1) to (100))
repeat until <(answer) = (RandomNumber)>
ask [Guess my number!] and wait
if <(answer) > (RandomNumber)>
say [Too high!]
else
say [Too low!]
end
end
say [You got it!]
This code uses a variable, a loop, and a condition.

Last edited by amcerbu (2013-01-11 16:29:49)

Offline

 

#3 2013-01-11 17:06:34

technoguyx
Scratcher
Registered: 2008-10-18
Posts: 1000+

Re: quick questions

A loop is a section of the script that repeats, sometimes as long as a condition is true. The Scratch blocks that allow you to create loops are:

forever
end
repeat (10)
end
forever if <condition>
end
repeat until <condition>
end
The blocks that allow you to check for a condition (without looping, unlike "forever if" and "repeat until") are:

if <condition>
end
if <condition>
else
end
wait until <condition>
And as for the last question, you can hide a sprite's speech bubble by using a say block with nothing in it:

say []
As for the last question, the "if" block checks for a condition when it's ran (that is, when you click the green flag), and then never again unless you run it again. Thus, it's best if you use the "wait until" block in this situation.


http://getgnulinux.org/links/en/linuxliberated_4_78x116.png

Offline

 

#4 2013-01-13 13:08:37

aaronsg
New Scratcher
Registered: 2013-01-11
Posts: 2

Re: quick questions

technoguyx wrote:

And as for the last question, you can hide a sprite's speech bubble by using a say block with nothing in it:

say []
As for the last question, the "if" block checks for a condition when it's ran (that is, when you click the green flag), and then never again unless you run it again. Thus, it's best if you use the "wait until" block in this situation.

Hey thanks alot didn't expect such a detailed reply its starting to make a lot of sense now . Looking back at my original question now i feel that ive learnt so much already as for the hiding a sprite's speech bubble i used this instead, it works too.

say [bye] for (2) secs 
thanks a bunch dude cant wait to try more complicated stuff

Offline

 

Board footer