User Tag List

Results 1 to 9 of 9

Thread: iOS game Development question for Gurus like U!

  1. #1
    Clickteam Clickteam
    Kisguri's Avatar
    Join Date
    Jun 2006
    Location
    Bakersfield, CA
    Posts
    3,058
    Mentioned
    39 Post(s)
    Tagged
    3 Thread(s)

    iOS game Development question for Gurus like U!

    So I have ships that the angle is selected off a selector wheel, I need the object to rotate to the selected direction using the quickest method, Clockwise or counter clockwise, But for the life of me I am having no luck, Any suggestions?


    Clickteam on Twitter - Clickteam on Facebook

  2. #2
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: iOS game Development question for Gurus like U!

    I don't know what you mean by selector wheel

    Do you want them to rotate towards the new angle smoothly or instantly? There is quite a big difference

  3. #3
    Clickteam Clickteam
    Kisguri's Avatar
    Join Date
    Jun 2006
    Location
    Bakersfield, CA
    Posts
    3,058
    Mentioned
    39 Post(s)
    Tagged
    3 Thread(s)

    Re: iOS game Development question for Gurus like U!

    The selector wheel is a object overlay that you tap to select the ships new angle/Direction, The overlay is set to only eight directions as per the design of the original board game the iOS title is after, So if I am facing angle 0 and I tap to go to angle 45 I need to find a method to allows me to event that in this case it would begin rotating counter clockwise and stopping at 45, Alternatively if I wanted to go from 0 to 270 I wouldn't want the ship to rotate counterclockwise but clockwise as this would be the quickest direction to 270. Thats where I am all buggered.


    Clickteam on Twitter - Clickteam on Facebook

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module

    Join Date
    Jan 2009
    Posts
    1,052
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: iOS game Development question for Gurus like U!

    for 2d rotate-towards function you usually use what it's best known as atan2 function. I don´t know whether MMF has such a function.

  5. #5
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: iOS game Development question for Gurus like U!

    Doesn't the Advanced Direction object has an action to rotate an object to a target angle/direction one step at a time? (it chooses the shortest way around)

  6. #6
    Clickteam Clickteam
    Kisguri's Avatar
    Join Date
    Jun 2006
    Location
    Bakersfield, CA
    Posts
    3,058
    Mentioned
    39 Post(s)
    Tagged
    3 Thread(s)

    Re: iOS game Development question for Gurus like U!

    I went through it and didn't find anything, But I will try again!


    Clickteam on Twitter - Clickteam on Facebook

  7. #7
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: iOS game Development question for Gurus like U!

    It's an expression
    Rotate( "Advanced Direction Object", dir, dirtrt, speed)

    Quote Originally Posted by Documentation
    Rotate - Gives you a direction calculated from the three parameters. The first parameter is the current direction. The second parameter is the direction to smootly rotate to. The third parameter is the rotating speed. The function will return the current direction after it has been rotated towards the direction to rotate to with the rotating speed.

  8. #8
    Clickteam Clickteam
    Kisguri's Avatar
    Join Date
    Jun 2006
    Location
    Bakersfield, CA
    Posts
    3,058
    Mentioned
    39 Post(s)
    Tagged
    3 Thread(s)

    Re: iOS game Development question for Gurus like U!

    So I would use that in the Angle Action then? I will give it a go, Thx Andos once again, you are the legend....


    Clickteam on Twitter - Clickteam on Facebook

  9. #9
    Clickteam Clickteam
    Anders's Avatar
    Join Date
    Jun 2006
    Location
    Denmark, Århus
    Posts
    3,456
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)

    Re: iOS game Development question for Gurus like U!

    It depends if you are using directions (32) or angles (360).
    If you are using directions you enter 32 in the Advanced Dir object dialog box, if not, leave it at 360.

    In the following expression you then chose either Dir or Angle from the object depending on what you want to use. I used the direction as an example:

    You can then always set the direction of "Object" to:
    Rotate( "Advanced Direction Object", Dir("Object"), <whatever dir you want here>, 1)
    You use '1' as the speed if it should rotate smoothly one angle/dir at a time. You use 8 if you want it to skip a lot of directions (then you might want to do it less often).

Similar Threads

  1. iPad and iPhone development question
    By Renatos in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 30th July 2011, 01:26 AM
  2. Indie development question?
    By SEELE in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 19th May 2008, 06:52 AM

Posting Permissions

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