Locked icon Circle Movement?

From the Asset Store
You can change amount and speed of circles, length of lines and etc. Only 6 events.
    • Post link icon

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

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
    • Post link icon

    Here's a way:

    circularMovement.capx (r99)

    • Post link icon

    You can do a math.

    How to do:

    create instance radians = 0;

    create instance degrees= 0;

    create instance radius = 100; // random radius

    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

    • Post link icon

    Hey Nimtrix and TELLES0808 Thanks for helping me :D!

    • Post link icon

    What about circle movement with pathfinding?

    • Post link icon

    What about circle movement with pathfinding?

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

    • Post link icon

    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" />

    • Post link icon

    You can do a math.

    How to do:

    create instance radians = 0;

    create instance degrees= 0;

    create instance radius = 100; // random radius

    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.

    • Post link icon

    Thank you Nimtrix...

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

    • Post link icon

    - try subtracting dt rather adding dt to t.

    • Post link icon

    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.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)