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

#1 2012-10-29 09:45:32

Rasengankirby
Scratcher
Registered: 2012-05-15
Posts: 14

How do you make the character walk left AND right?

How do you make the main sprite walk left AND right with the arrow keys?

Offline

 

#2 2012-10-29 10:08:08

30-1
Scratcher
Registered: 2012-08-08
Posts: 100+

Re: How do you make the character walk left AND right?

Use this script

when gf clicked
forever
 if <key [right arrow v] pressed?>
  change x by (2)
 end
 if <key [left arrow v] pressed?>
  change x by (-2)
 end
or
when key [right arrow v] pressed
change x by (3)
when key [left arrow v] pressed
change x by (-3)
...

Last edited by 30-1 (2012-10-29 10:08:36)


http://i.imgur.com/ocOya7x.gif
I. Text I Based I Games I

Offline

 

#3 2012-10-29 10:08:53

mythbusteranimator
Scratcher
Registered: 2012-02-28
Posts: 1000+

Re: How do you make the character walk left AND right?

Really easily.

When key (right arrow) pressed
repeat until <not <right arrow pressed>>
change x position by 3


And then do the same with the left arrow.  smile


http://www.foxtrot.com/comics/2012-04-01-fdb37077.gif
clicky

Offline

 

#4 2012-10-29 15:47:56

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

Re: How do you make the character walk left AND right?

mythbusteranimator wrote:

Really easily.

When key [right arrow v] pressed
repeat until <not <key [right arrow v] pressed?>>
 change x by (3)
end
And then do the same with the left arrow.  smile

I put your scripts in scratchblocks.

Last edited by ErnieParke (2012-10-29 15:48:39)


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

Offline

 

Board footer