User Tag List

Results 1 to 9 of 9

Thread: Moves left more than right

  1. #1
    No Products Registered

    Join Date
    Mar 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Moves left more than right

    Can someone help me with this problem?

    This is a really basic example of a problem I am having with moving, I stripped away all of the parts of the engine except for this part which is causing the problems.

    The engine moves an object based on what its alterable value A is, and then it slows the object's movement by multiplying it by 0.5.

    In the example there are two objects, they have the exact same events except one gets a negative number and one gets a positive number. The blue one moves right and the red one moves left when you [color:#FF0000]press space[/color].

    According to the counters the two objects should be moving the same amount, but the one moving left using negative numbers always slides a lot further than the one moving right. The formulas they have are exactly the same so I don't know what is wrong here.

    Is there something I'm overlooking?
    Thanks in advance for help!
    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Mar 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    Sorry to post twice in a row, but I ran into the same problem doing something different.

    I decided I would go about it easier by just adding and subtracting instead of using multiplication/division to get to where I wanted to be, but I have the exact same problem again.

    [color:#FF0000]Press Space[/color] to set the objects into motion. The counters show they have the same alterable value, but the one moving left always moves a little further than the one moving right.

    Is everyone having this same problem with these files, or is it just me?

    My MMF is up to date with build R247.
    Attached files Attached files

  3. #3
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    remove the events (>-0.1 and <0.1) and you will see some truly weird stuff, i haven't found why yet....



    The problem is in 'set position'....



    [edit]found it, when subtracting flout points from positions it seems to get stuck, it obviously rounds to the closest pixel but it don't seem to subtract the change from the position, hence anything under 0.5 will just keep moving until absolute zero.

    maybe you should talk to Vyes or who's ever handles this part of the engine; it seems to be a bug.

  4. #4
    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,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    It's because the x-position doesn't take decimals. Even though you use decimals in your calclutaions, when it adds or substracs the xpos it goes wrong.

    Instead of using the xposition in the calculations, change it with an alterable value. At start of level, set the alterable value to the xposition, and always set the xposition to the alterable value plus Alterable value A.

  5. #5
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    I see, that wouldn't be hard to fix, they would simply need a round calculation behind the scenes when setting position.

  6. #6
    No Products Registered

    Join Date
    Mar 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    I need the objects to move away and slow down then stay in the same spot though.
    When I do what you said Popcorn the objects always wind up in the same spot they started in.


    I guess I should just cut to using non decimals and use timer events for the slow down.

    Thanks for trying to help you guys.

    I understand that the movement doesn't work with decimals, I just am trying to figure out why it works differently going negative and positive.

  7. #7
    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,367
    Mentioned
    13 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    My method works, I can send you the file if you want.
    I said above why the two moves differently. It is because one of the values in the calculation doesn't care about decimals, and therefore there will be some difference between the two.

    When you use an alterable value instead, the decimals are counted for all the way, and the positition will be set correctly all the way too.

  8. #8
    Clicker Multimedia Fusion 2
    SEELE's Avatar
    Join Date
    Jul 2007
    Location
    Terra australis incognito
    Posts
    1,916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    dw, popcorn ill do it.
    Attached files Attached files

  9. #9
    No Products Registered

    Join Date
    Mar 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Moves left more than right

    Oh I see what I did, I left out a little part.

    That's perfect you guys!

    Thanks a ton both of you!

Similar Threads

  1. Again movement stops after a few moves. #beta 31, 32
    By ineke in forum Android Export Module Version 2.0
    Replies: 12
    Last Post: 7th July 2012, 06:04 PM
  2. Detect when no more moves in Advanced Game Board
    By Keith in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 31st August 2011, 09:34 PM
  3. Player moves with ship Problem.
    By Worf in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 7th January 2010, 08:56 AM
  4. How to determine when the mouse moves off object
    By RCL in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 20th November 2008, 06:37 PM
  5. space bar moves it
    By delusan in forum The Games Factory 2 - Technical Support
    Replies: 4
    Last Post: 27th May 2007, 05:35 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
  •