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

#1 2011-04-19 16:36:17

bokin
New Scratcher
Registered: 2011-04-19
Posts: 3

newb question

I am trying to make an animation occur with the mouse button is clicked anywhere on the stage so i have the "mousedown" function within an If control and then the glide motion in the If control. When i try to play it nothing happens when I click my mouse. I'm pretty sure I've made the mousedown function true, but I can't tell because the little speech bubble that tells you so keeps changing and disappearing! please help!
<if><mouse down?>
<glide(  )secs to x sad   )y sad
<end>

Offline

 

#2 2011-04-19 16:51:23

JT5
New Scratcher
Registered: 2011-04-17
Posts: 10

Re: newb question

You may have forgot to put your if statement inside a forever loop. Try this:


[blocks]
<forever>
<if><mouse down?>
<glide(  )secs to x sad   )y sad 
<end>
<end>
[/blocks]

That should work  smile

Offline

 

#3 2011-04-19 17:10:48

bokin
New Scratcher
Registered: 2011-04-19
Posts: 3

Re: newb question

i tried that it didn't work

Offline

 

#4 2011-04-19 17:20:28

bokin
New Scratcher
Registered: 2011-04-19
Posts: 3

Re: newb question

this is my code so far with it working.
I just need to replace the initial wait(4secs) with the mousedown so that it begins when the mouse it clicked instead of just waiting and playing.

<when green flag clicked>
<set x to( -164
<set y to( -70
<wait(  4
<play sound[
<wait( 1
<glide( 1 )secs to x sad -70  )y sad  -40

Offline

 

#5 2011-04-19 17:45:06

JT5
New Scratcher
Registered: 2011-04-17
Posts: 10

Re: newb question

Replace the wait 4 seconds with:

[blocks]
<wait until><mouse down?>
[/blocks]

Now that should (hopefully) work  big_smile

Offline

 

Board footer