User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 20

Thread: Rotate towards and shortest rotate direction

  1. #1
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Rotate towards and shortest rotate direction

    Seems that i`m getting old. I cannot figure out what to do here

    I have a car. I want to control it with the mouse. Always look at mouse is not really useful to control a car, because it rotates too fast. So i need to buffer it. Means i need a slowly rotation towards the mouse position.

    What i`ve done in the attached file is simple. I have added another active. This one always looks in direction of the mouse. And then i have added two simple events. When direction of active greater direction of car, add 1 to direction of car. And vice versa. It works fine as long as i avoid to go through the direction 31 or 0

    But then it fails. Because in the area 31 and 0 the value snaps from 31 to 0 and from 0 to 31, and the car rotates the whole 360 degrees instead the missing 1 direction then.

    Has somebody an idea how i can bring the car to rotate the shortest direction, means the missing 1 direction instead to rotate the other 31 directions?
    Attached files Attached files

  2. #2
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Advanced Direction Object has this built-in.
    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=197871


    If you want decimal accuracy in HWA (2 decimal places) then set the directions from 360 to 36000 and just divide/multiply by 100.
    Working as fast as I can on Fusion 3

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Thanks LB, having a look at it now

    But i search for a non extension solution when possible. Even when the Advanced Direction Object extension is already converted to Flash.

    And i don`t want to rotate the image, i want to change the direction. That`s something completely different. Let`s have a look if i am able to adopt your linked example to directions instead angles

  4. #4
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Nope, doesn`t work. I need a bouncing ball movement for the car.

  5. #5
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Finally got it. So simple in the end. All i needed was to compare if the difference in the two directions is below or above 16. And then rotate in opposite directions when the difference is bigger than 16.

    Now it always rotates the shortest distance between the directions. Without extensions. Example is attached
    Attached files Attached files

  6. #6
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Glad you got it to work

    Quote Originally Posted by Tiles
    And i don`t want to rotate the image, i want to change the direction. That`s something completely different.
    Just set the Advanced Direction Object to use 32 directions instead.
    Working as fast as I can on Fusion 3

  7. #7
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Just set the Advanced Direction Object to use 32 directions instead. wink
    And that makes it to rotate the directions instead to rotate the image? :confused:

    I need Bouncing Ball movement with its bounce and accelleration/decelleration for what i want to do. And then your method with using the Adv Dir Object to rotate the image and to put the position by fastloop simply doesn`t fit. Fastloop is no good idea for a flash game anyways. I want to avoid that when even possible.

    In the end i have figured out what i want to do in five simple lines of code. And have saved an extension and a fastloop. Perfect

    Nevertheless, thanks for help

  8. #8
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    First of all, it doesn't "rotate the image" for you. The advanced direction object takes a current direction, a target direction, and a rotate speed. Then it gives you the new direction. You can choose to sue it for image angle or for object direction.
    Working as fast as I can on Fusion 3

  9. #9
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module
    Tiles's Avatar
    Join Date
    Jun 2006
    Posts
    1,359
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    How does this direction thingie work?

    Anyways, it does not work with Bouncing Ball Movement.

    What i wait for since years is to have the standard movements with more than 32 directions. But that is something never happening in MMF it seems

  10. #10
    Clickteam Clickteam
    LB's Avatar
    Join Date
    Jun 2007
    Location
    Richardson, Texas, North America
    Posts
    8,937
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Re: Rotate towards and shortest rotate direction

    Quote Originally Posted by Tiles
    How does this direction thingie work?
    I just told you

    Quote Originally Posted by Tiles
    Anyways, it does not work with Bouncing Ball Movement.
    It works for me...?
    Working as fast as I can on Fusion 3

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Help Please... Need to Rotate Rotate object with a wheel
    By Tuna in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 12th February 2012, 04:48 PM
  2. 360 rotate object
    By Evilized79 in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 19th July 2011, 07:38 PM
  3. rotate screen?
    By Chokito in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 11th January 2009, 11:43 AM
  4. Rotate at object
    By jellytot in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 2nd January 2007, 06:55 PM
  5. Rotate direction towards object
    By Matt_Gardner in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 16th August 2006, 04:34 PM

Posting Permissions

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