# Circle Movement?

0 favourites
• 11 posts
From the Asset Store
Run and Jump in 3 Dimensions! Take your platformer to the next level!

Hey all, do you have a good idea how to make a circle movement using sine or something else?

Here's a way:

circularMovement.capx (r99)

You can do a math.

How to do:

create instance degrees= 0;

initial.x = 50; // random primary x position

initial.y = 50; // random primary y position

Every Thick

degrees = degrees + 5; // each time degrees is increased by 5 degrees

radians = degrees * Math.PI/ 180;

sprite.y = initial.y + Math.sin(radians) * radius // because sin A = y/r

sprite.x = initial.x + Math.cos(radians) * radius // because cos A = x/r

Hey Nimtrix and TELLES0808 Thanks for helping me :D!

What about circle movement with pathfinding?

What about circle movement with pathfinding?

Farsight Use animation to make fake circle animation, you wouldn't alternate the pathfinding movement using sine behavior

i already find another way without pathfinding) i create big circle sprite, its invisible on start and have spin behavior. And when unit appears its pin to circle <img src="smileys/smiley1.gif" border="0" align="middle" />

You can do a math.

How to do:

create instance degrees= 0;

initial.x = 50; // random primary x position

initial.y = 50; // random primary y position

Every Thick

degrees = degrees + 5; // each time degrees is increased by 5 degrees

radians = degrees * Math.PI/ 180;

sprite.y = initial.y + Math.sin(radians) * radius // because sin A = y/r

sprite.x = initial.x + Math.cos(radians) * radius // because cos A = x/r

I've been struggling to get this circular movement right, and finally your solution worked best for me..Thanks a lot.

Thank you Nimtrix...

And please explain me to rotate the same object in reverse order... which you provided in the sample..

- try subtracting dt rather adding dt to t.

• ## Try Construct 3

Develop games in your browser. Powerful, performant & highly capable.

Construct 3 users don't see these ads

Thank you Nimtrix...

And please explain me to rotate the same object in reverse order... which you provided in the sample..

Just change the sin and cos around.

• 11 posts