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

#1 2008-08-24 14:15:24

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Basic movement for scratch beginners.

Basic method:
Put this in the sprite that you want to move.


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

  <if><key[ right arrow ]pressed?>
  <change x by( 3 )
  <end>
<end>

Basic method2:

This gives a sprite a velocity effect

make a variable called "xvelocity"

<when green flag clicked>
<forever>
  <set x to( <{ xvelocity }> )
  <set{ x velocity  }to( (( <{ xvelocity }> <*> .95 ))
  <if><key[ right arrow ]pressed?>
     <change{ xvelocity }by( .3 )
  <end>
  <if><key[ left arrow ]pressed?>
  <change{ xvelocity }by( -.3 )
  <end>
<end>

For a project demonstration here it is

Last edited by keroro645 (2008-08-24 16:35:41)

Offline

 

#2 2008-08-24 15:17:01

Kingbradley6
Scratcher
Registered: 2007-05-17
Posts: 100+

Re: Basic movement for scratch beginners.

Nice tutorial and outcome.

Offline

 

#3 2008-08-26 14:56:53

mletreat
Scratcher
Registered: 2008-05-01
Posts: 100+

Re: Basic movement for scratch beginners.

Thanks keroro645 - are these methods you used when you first started making projects?  Maybe you could share some of the projects you first started with  smile

Offline

 

#4 2008-12-02 07:20:58

kitty7779
Scratcher
Registered: 2008-11-30
Posts: 11

Re: Basic movement for scratch beginners.

now that helps

Offline

 

Board footer