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

#1 2010-08-07 09:24:48

IHeartGaming
Scratcher
Registered: 2010-07-23
Posts: 1000+

Move UP/DOWN 10 steps

How do you move up or down 10 steps???

(Please tell me in blocks.)


IHeartGaming

Offline

 

#2 2010-08-07 09:35:00

colorfusion
Scratcher
Registered: 2009-10-03
Posts: 500+

Re: Move UP/DOWN 10 steps

http://i38.tinypic.com/10e1lzq.jpg

Depending on if you want it relative to the direction or not.

Last edited by colorfusion (2010-08-07 09:38:37)

Offline

 

#3 2010-08-07 21:07:20

m71134
Scratcher
Registered: 2010-03-03
Posts: 1000+

Re: Move UP/DOWN 10 steps

<when[ up arrow ]key pressed>
<point in direction( 0
<move( 10 )steps>

<when[ down arrow ]key pressed>
<point in direction( 180
<move( 10 )steps>

You can also do it this way:

<when[ up arrow ]key pressed>
<change y by( 10

<when[ down arrow ]key pressed>
<change y by( -10

Offline

 

#4 2010-08-08 13:18:42

hmnwilson
Scratcher
Registered: 2007-07-04
Posts: 1000+

Re: Move UP/DOWN 10 steps

Does it have to use steps? Because if you're just trying to make a 4-way direction system, you're better off using the change x/y blocks instead.

Kind of like this:
<when green flag clicked>
<forever>
<if><key[ up arrow ]pressed?>
  <change y by( 10
<end>
<if><key[ down arrow ]pressed?>
  <change y by( -10
<end>
<if><key[ left arrow ]pressed?>
  <change x by( -10
<end>
<if><key[ right arrow ]pressed?>
  <change x by( 10
<end>
<end>[/blocks]

Last edited by hmnwilson (2010-08-08 13:22:43)


I'm taking a break from Scratch until 2.0 comes out. Any messages sent between then and now probably won't be read - sorry.
(Oct. 20, 2011)

Offline

 

Board footer