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

#1 2012-08-04 18:10:31

Kajunkat
Scratcher
Registered: 2012-06-30
Posts: 37

Help Please!

Question 1:

How can you program a sprite to ask a question, and when it gets a specific answer, broadcast something?

Question 2:

I want to make a sprite, when touching the mouse, change to a different costume. But, If it isn't touching the mouse, go back to it's 1st costume. How can I do this?

Offline

 

#2 2012-08-04 18:16:32

Prestige
Scratcher
Registered: 2008-12-15
Posts: 100+

Re: Help Please!

ask [what is the codeword?] and wait
if <(answer) = [hello!]>
broadcast [start v]
forever
if <touching [mouse-pointer v]?>
switch to [costume 2 v]
else
switch to [costume 1 v]
smile

Last edited by Prestige (2012-08-04 18:18:32)


"Don't insult someone until you've walked a mile in their shoes. That way, if they don't like what you have to say, you'll be a mile away and still have their shoes  smile  "

Offline

 

#3 2012-08-04 21:22:16

ErnieParke
Scratcher
Registered: 2010-12-03
Posts: 1000+

Re: Help Please!

Prestige wrote:

ask [what is the codeword?] and wait
if <(answer) = [hello!]>
broadcast [start v]
forever
if <touching [mouse-pointer v]?>
switch to [costume 2 v]
else
switch to [costume 1 v]
smile

I added and changed a few things:

when gf clicked
ask [what is the codeword?] and wait
if <(answer) = [hello!]>
 broadcast [start v]
end
when gf clicked
forever
 if <touching [mouse-pointer v]?>
  switch to costume [costume 2 v]
 else
  switch to costume [costume 1 v]
 end

Last edited by ErnieParke (2012-08-04 21:27:27)


http://i46.tinypic.com/35ismmc.png

Offline

 

Board footer