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

#1 2009-03-01 14:53:20

Foxgirlgamer
Scratcher
Registered: 2009-02-28
Posts: 49

Up and down?

OK so, how do I make something go up and down? I can make them go right:
if Right key pressed
move 10 spaces
and left
if Left key pressed
move -10 spaces
but I cant make them go up or down! How do I do it!? HELP!


Random unpopular scratch member: banan007! SUPPORT THEM! http://scratch.mit.edu/users/banan007

Offline

 

#2 2009-03-01 15:07:50

djm111
Scratcher
Registered: 2008-10-29
Posts: 1000+

Re: Up and down?

If Up Key pressed
Change y by 10
If Down Key pressed
Change y by -10


http://i627.photobucket.com/albums/tt358/Dazzamcgazza/sig.png

Offline

 

#3 2009-03-01 15:14:53

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: Up and down?

Foxgirlgamer wrote:

OK so, how do I make something go up and down? I can make them go right:
if Right key pressed
move 10 spaces
and left
if Left key pressed
move -10 spaces
but I cant make them go up or down! How do I do it!? HELP!

r u new at scratch?

Offline

 

#4 2009-03-01 15:16:24

Foxgirlgamer
Scratcher
Registered: 2009-02-28
Posts: 49

Re: Up and down?

Yes, very, I downloaded it yesterday


Random unpopular scratch member: banan007! SUPPORT THEM! http://scratch.mit.edu/users/banan007

Offline

 

#5 2009-03-01 15:30:55

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: Up and down?

Foxgirlgamer wrote:

Yes, very, I downloaded it yesterday

oh, well welcome to scratch!  smile

Offline

 

#6 2009-03-01 15:37:12

Foxgirlgamer
Scratcher
Registered: 2009-02-28
Posts: 49

Re: Up and down?

Thank you, its fun


Random unpopular scratch member: banan007! SUPPORT THEM! http://scratch.mit.edu/users/banan007

Offline

 

#7 2009-03-01 15:39:11

golfer3
Scratcher
Registered: 2008-11-02
Posts: 1000+

Re: Up and down?

Foxgirlgamer wrote:

Thank you, its fun

your welcome, i like it alot too!  smile

Offline

 

#8 2009-03-01 22:51:43

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Up and down?

quick tip about X and Y. X is the Horizontal movement of a sprite (left and right) changing it will make it go left or right (positive right negative left). They Y is the vertical movement (up and down) positive up negative down. Moving steps is going in the direction that the sprite is pointing at.

Offline

 

#9 2009-03-01 22:55:01

Xzeleous
Scratcher
Registered: 2009-02-27
Posts: 24

Re: Up and down?

ooo! I know this one  big_smile
<when[ up ]key pressed>
<change y by( somthin positive)
<stop script>
<when[ down ]key pressed>
<change y by( something negative)
<stop script>


Anaglyphic US Constitution Animation: http://scratch.mit.edu/projects/Xzeleous/729698

Offline

 

#10 2009-03-01 23:57:25

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

Re: Up and down?

Xzeleous wrote:

ooo! I know this one  big_smile
<when[ up ]key pressed>
<change y by( somthin positive)
<stop script>
<when[ down ]key pressed>
<change y by( something negative)
<stop script>

[/blocks]
You don't actually need the stop script blocks, but that would be how you do it.


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

 

#11 2009-03-02 06:18:17

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Up and down?

no. The above should NOT be done. This is completly incorrect scripting. the when X key pressed  script head is used for things such as typing, as it works simaler (has a delay before looping). I'll quickly make a flash project with these two to show how it works.

Offline

 

#12 2009-03-02 06:31:57

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Up and down?

http://spamtheweb.com/ul/upload/020309/52103_Event_Head_loop_example.php
All you need to know in this example is that event head method is the one above and loop is one that looks like this
<when green flag clicked>
<forever>
  <if>(Key right is pressed)
   <change x by( 4 )
   <end>
   <if>(Key Left is pressed)
    <change x by( -4)
    <end>
<end>

Offline

 

Board footer