User Tag List

Results 1 to 4 of 4

Thread: ratating around an object

  1. #1
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question ratating around an object

    I want to it so a character will circle around whatever it is focused on if the left and right arrows are being held down
    and it will move closer or further away from the target if the up and down arrows are pressed
    I also want the character to continue to face what is focused on.

    I think i can figure out the other parts, but the circular motions for left and right is a bit tricky.

    Thanks

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,344
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I advice you to use normal trigonometry for this
    Set the player object to Static movement, which means it will have no movement and you code it in the event editor instead.
    You will need to always set its X and Y position individually so that you can use a calculation.

    The formula for X is:
    Always set X to: X of Target + RADIUS * Sin(ANGLE)

    And the formula for Y is:
    Always set Y to: Y of Target + RADIUS * Cos(ANGLE)

    Target is the object the player will rotate around, RADIUS is is distance the PlayerObject will have from the object, and ANGLE is where in the circle around the target the PlayerObject currently is.
    You will have to make a counter or set up a global value or an alterable value for the RADIUS and another one for the ANGLE.

    You can now have events that adds to or subtract from RADIUS and ANGLE to stear the PlayerObject.

    I hope that was understandable

    To make the PlayerObject face the target, simply use the Clickteam Movement Controller in the expression editor when setting the PlayerObject's angle. It can find angle between to objects or positions, so you want to always set the angle of the PlayerObject to the angle between itself and the target. Or use trigonometry for this as well, although I cannot help you there.

  3. #3
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you can do what popcorn said; set the X of the character to target's X position + sin(angle)* distance, Y to the targets Y position + cos(angle)*distance;
    and you could simply LOOK at the target (with 32dirs); or do it with math...
    set the characters angle to: ATan2(character's Y pos - targets Y pos, characters X pos - targets X pos) + 180

  4. #4
    Clicker Fusion 2.5 DeveloperSWF Export Module

    Join Date
    Sep 2006
    Posts
    511
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for responding. I've been trying to figure this out based on what you said. It sounds very possible, but requires serious focus to put it together. Hopefully I'll have a chance to get something going this weekend. I'll post how it went.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •