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

#1 2012-11-02 15:18:28

l_branco
New Scratcher
Registered: 2012-10-08
Posts: 5

stop and go glider and spacebar

Hi,

I am trying to make my sprite walk across the screen and stop by pressing the spacebar before he bumps into something.  He will pause for x seconds when the spacebar is hit and then continue walking. 

I am using the glide function to get him to move.
The touching function alerts me if he bumps into the object.
How do I the spacebar to pause the glide function for x seconds and then continue from the spot it stopped.

Thanks

Offline

 

#2 2012-11-02 15:24:38

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: stop and go glider and spacebar

when gf clicked 
forever
if <key [space v] pressed?>
wait (x) secs
end
move (speed) steps//or change x by speed


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#3 2012-11-03 15:18:41

l_branco
New Scratcher
Registered: 2012-10-08
Posts: 5

Re: stop and go glider and spacebar

thanks for your post.  it totally makes sense.  however still not working.
my first command is when flag clicked set x then glide.
I added your suggestion and get no effect.

Offline

 

#4 2012-11-03 16:25:07

gfchll
Scratcher
Registered: 2012-04-21
Posts: 100+

Re: stop and go glider and spacebar

 when gf clicked
repeat until < key [space v] pressed?>
glide (1) secs to x:() y:()
end
wait () secs
glide () secs to x:() y:()


HELLO EVERYBODY!

Offline

 

Board footer