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

#1 2012-03-31 04:54:51

mayboy70
New Scratcher
Registered: 2012-03-31
Posts: 3

How do you make a sprite move in a circle at a constant pace?

Hi everyone, I'm trying to make a game  and I need my enemy sprites to move in circles so please can you help me.

Offline

 

#2 2012-03-31 06:20:37

xJira
Scratcher
Registered: 2012-03-24
Posts: 91

Re: How do you make a sprite move in a circle at a constant pace?

Hi mayboy!
You can let an object move in Circles with this script ...

when gf clicked
forever
   turn cw (2) degrees
   move (2) steps
   end
end

When you turn just 1 degree, the circles will be larger, more then 2 degree and the circles will be smaller. Also, if you go more then 2 steps, the circles become larger and the other way around smaller  smile  You'll have to test this!

Offline

 

#3 2012-03-31 06:26:43

xJira
Scratcher
Registered: 2012-03-24
Posts: 91

Re: How do you make a sprite move in a circle at a constant pace?

when gf clicked
forever
   turn cw (2) degrees
   move (2) steps
   end
end
Uhm sorry, now, this is the script  smile  And! If you say, repeat until "touching sword?" for example, you can also ad a "hide"-block, at the end and your enemys will disappear when you attack them  smile

when gf clicked
repeat until <touching (sword) ?>
   turn cw (2) degrees
   move (2) steps
   end
hide

Offline

 

#4 2012-03-31 08:22:55

jontmy00
Scratcher
Registered: 2011-11-28
Posts: 1000+

Re: How do you make a sprite move in a circle at a constant pace?

The higher the number in your

 turn () left degrees 
or
 turn () right degrees 
, the smaller your circle will be.

Last edited by jontmy00 (2012-03-31 08:32:35)


FOR ALL THE NEWS ON UPDATES FOR SIMPLISTICRAFT, CLICK HERE.

Offline

 

#5 2012-03-31 22:41:56

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: How do you make a sprite move in a circle at a constant pace?

The scripts above are great, but it won't lag position wise if you use:

forever
 go to x: (([sin v] of ((timer) * (50))) * (100)) y: (([cos v] of ((timer) * (50))) * (100))
I'm obsessed with the Help With Scripts topic  tongue
I suppose that's a good thing...

Last edited by chanmanpartyman (2012-03-31 22:43:01)

Offline

 

#6 2012-04-01 08:19:51

OrangeKing-test
Scratcher
Registered: 2012-03-01
Posts: 2

Re: How do you make a sprite move in a circle at a constant pace?

you just make the center of the sprite the exact center but the computer will automatically do that and then you make this script

when gf clicked
forever
    turn 1 degrees right
end
say [this is how to make it] for (13) secs

Offline

 

#7 2012-04-01 16:11:51

chanmanpartyman
Scratcher
Registered: 2011-05-30
Posts: 500+

Re: How do you make a sprite move in a circle at a constant pace?

OrangeKing-test wrote:

you just make the center of the sprite the exact center but the computer will automatically do that and then you make this script

when gf clicked
forever
    turn cw (1) degrees
end
say [this is how to make it] for (13) secs

Fixed

Offline

 

#8 2012-04-05 04:10:43

mayboy70
New Scratcher
Registered: 2012-03-31
Posts: 3

Re: How do you make a sprite move in a circle at a constant pace?

thanks everyone but is there any other ways to make to move in a circle

Offline

 

Board footer