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

#1 2009-05-30 11:52:48

louieansonng
Scratcher
Registered: 2009-05-30
Posts: 2

rotating while moving

Hi, I'm a new user here at scratch and we're using this program in our course in Computer Science to create interactive games for kids. I was wondering how to make rotating objects that are moving. Using the move x degrees only lets it move in circles, and rotating it 360 degrees doesn't work. Thanks in advanced for the help

Offline

 

#2 2009-05-30 11:56:25

fruit
Scratcher
Registered: 2009-04-24
Posts: 1000+

Re: rotating while moving

<when green flag clicked>
<forever>
<turn cw( whatever )degrees> or <turn ccw( whatever )degrees>
<end>

Last edited by fruit (2009-05-30 11:56:43)


@savi3000 | hcsmp.com

Offline

 

#3 2009-05-30 15:48:59

cheddargirl
Scratch Team
Registered: 2008-09-15
Posts: 1000+

Re: rotating while moving

louieansonng wrote:

Hi, I'm a new user here at scratch and we're using this program in our course in Computer Science to create interactive games for kids. I was wondering how to make rotating objects that are moving. Using the move x degrees only lets it move in circles, and rotating it 360 degrees doesn't work. Thanks in advanced for the help

It sounds like you want a sprite to rotate while still changing its x and y positions, yes?
Perhaps two scripts running simultaneously might be what you need: one to control the rotation, the other to control the sprite movement in the x and y direction. The following blocks control sprite position:

<move(     )steps>
<go to x sad      )y sad     
<glide(     )secs to x sad      )y sad     
<change x by(   
<set x to(   
<change y by(   
<set y to(   
[/blocks]

Last edited by cheddargirl (2009-05-30 15:49:45)


http://i.imgur.com/8QRYx.png
Everything is better when you add a little cheddar, because when you have cheese your life is at ease  smile

Offline

 

#4 2009-05-31 05:43:54

louieansonng
Scratcher
Registered: 2009-05-30
Posts: 2

Re: rotating while moving

Thanks. I'll try and play with the blocks and see if I can get it right.

Offline

 

#5 2009-06-10 15:14:43

fire219
Scratcher
Registered: 2008-02-07
Posts: 1000+

Re: rotating while moving

Do it like this:
[blocks]<when green flag clicked>
           <forever>
             <move( any number needed )steps>
             <turn cw (any #)degrees> OR  <turn cw (any #)degrees>
           <end>[/blocks]
Hope that helps!!!!!

Last edited by fire219 (2009-06-10 15:17:50)


http://bluetetrarpg.x10.mx/usercard/img.php?name=fire219

Offline

 

Board footer