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

#1 2009-10-29 16:03:51

amar1997
Scratcher
Registered: 2009-10-16
Posts: 1

Moving Sprites

Im new, and I think it would be helpful if you let us move sprites by holding them (mouse down on it) and pressing the arrows on the keyboard to move.

Offline

 

#2 2009-10-29 16:20:30

steppenwulf
Scratcher
Registered: 2009-07-23
Posts: 1000+

Re: Moving Sprites

There is a way to move sprites with the keyboard and with the mouse.


For mouse moving, apply this script to your sprite:

<when green flag clicked>
<forever if><< <mouse down?> <and> <touching[ mouse pointer >>
<go to[ mouse pointer
<end>


For arrow key movement, apply these scripts:

<when green flag clicked>
<forever if><key[ right ]pressed?>
<change x by( 7
<end>

<when green flag clicked>
<forever if><key[ left ]pressed?>
<change x by( -7
<end>

<when green flag clicked>
<forever if><key[ up ]pressed?>
<change y by( 7
<end>
<when green flag clicked>
<forever if><key[ down ]pressed?>
<change y by( -7
<end>


I'm graduating HS this April and going to college in the Fall.

Offline

 

Board footer