User Tag List

Results 1 to 6 of 6

Thread: 8 direction motion bug

  1. #1
    Clicker Multimedia Fusion 2 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    drnebula's Avatar
    Join Date
    Jul 2006
    Location
    Pennsylvania, USA
    Posts
    908
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    8 direction motion bug

    Here is a file with an object with movement in diagonal directions only. It acts differently in one diagonal direction than it does in another - I can't see why it should this. I'm hoping that I'm missing something. Anyone get the same problem?

    I simplified the code to remove as much as possible. I took out all of the animation and made each direction have the same graphic with the same x and y point. I removed all of the buttons except for the ones that go diagonally - 7 = up and left for example. The problem still persists. If you toggle back and forth between the 7 and 3 directions, the ship goes at 45 degrees and stays in place. If you toggle back and forth between the 9 and 1 buttons, the ship does not go at 45 degrees and slowly moves up and to the right. The code is so simple at this point, it would seem to be some kid of bug.

    Steve
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    drnebula's Avatar
    Join Date
    Jul 2006
    Location
    Pennsylvania, USA
    Posts
    908
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 8 direction motion bug

    Could a few people at least verify that the object is indeed not moving at 45 degrees in one diagonal while it is in the other diagonal? This bug is really bothering me.
    STeve

  3. #3
    Clicker Fusion 2.5 Developer

    Join Date
    Oct 2006
    Location
    Finland
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 8 direction motion bug

    I figured it out! =)

    The built in position system doesn't have decimals, so you can only full pixel to position. If there are decimal values, they'll be rounded down. Alterable values support decimals. Here's a fixed version.
    Attached files Attached files

  4. #4
    Clicker Multimedia Fusion 2 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    drnebula's Avatar
    Join Date
    Jul 2006
    Location
    Pennsylvania, USA
    Posts
    908
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 8 direction motion bug

    Tomssuli,
    I really appreciate you figuring this out.

    But I'm still a bit confused about what is going on.

    I set the speed to 5 and took either the sin or cos, so 5*sin 45 = 3.535 which was rounded down to 3. The % error between 3.535 and 3 is a whopping 15%, so that explains the possible error.

    But, why does the error only happen in the 7 and 3 directions, and not in the 9 and 1 directions?

    Steve


  5. #5
    Clicker Fusion 2.5 Developer

    Join Date
    Oct 2006
    Location
    Finland
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 8 direction motion bug

    I think it does have to do with the adding/substracting... If it always rounds down, then when substracted, 3.535 turns first into -3.535 and then is rounded down to -4... where added will be rounded down to 3. That causes certain directions go wrong.

    For example: "Xcoord - 4px and Ycoord + 3px = not 45 degrees"

    Of course "-4x & -4y = 45deg" as is "+3x & +3y"

    That's what I think it's all about.

  6. #6
    Clicker Multimedia Fusion 2 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    drnebula's Avatar
    Join Date
    Jul 2006
    Location
    Pennsylvania, USA
    Posts
    908
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: 8 direction motion bug

    Thanks again to Tomssuli for figuring this out. I have remade the homemade 8 direction widget and will upload in the widget up load section.

    Steve

Similar Threads

  1. 8 direction motion & space motion widget
    By drnebula in forum Widgets
    Replies: 13
    Last Post: 15th June 2012, 09:25 AM
  2. Home Made 8 Direction Motion for Shawn
    By drnebula in forum File Archive
    Replies: 4
    Last Post: 16th March 2009, 06:09 AM
  3. Motion blur
    By Pkeod in forum Multimedia Fusion 2 - Technical Support
    Replies: 10
    Last Post: 29th March 2007, 08:26 PM
  4. Motion Blur
    By Sphax in forum File Archive
    Replies: 4
    Last Post: 1st July 2006, 04:25 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
  •