User Tag List

Results 1 to 6 of 6

Thread: Speed of Movement and Timing

  1. #1
    No Products Registered

    Join Date
    Dec 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Speed of Movement and Timing

    How can I tell where an object will end up after a few seconds? If I have an object with a certain amount of speed go from the top to the bottom of a 480px frame, how long would that take?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depends on what movement type you are using.
    Are you using one of the built in movement types?

    In general ( for Object with a constant speed ) it would be:

    'speed per Frame'( in pixels ) / Distance( in pixels )

    Now you have the 'number of Game Frames' it takes Object to cover the distance.
    Convert that to 'time' by dividing it by the FPS( Frames Per Second ) of your application ( 60 by default ).

  3. #3
    No Products Registered

    Join Date
    Dec 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do i find/set the speed per frame though? in pixels

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Im sorry, i missread your original post.

    Hope this doesnt confuse you, and maybe you allready know this...

    First understand that 1 'Game/ Applicaton Frame' is '1 unit of time' for Fusion.
    What happens in 1 Game frame is ( #1 ) All the code is run and ( #2 ) the display is uppdated ( example: Objects change possitions and/ or Objects are destroyed or created in accordance with the code etc )

    ...
    You are wanting to predict where a moving Object will be locaed afte X seconds/ time, correct?

    EXAMPLE
    - If Object is moving at a constant 'Speed', say 7 pixels per Game Frame, in the right direction
    - And you want to know where the Object will be located after 10 Game Frames

    - The Objects possition after X Frames will be: 'Objects Xposition' + 7 * 10
    - In other words its 'Object position + Speed * Time'
    ^ I know this is very basic, but its just to get the point across

    ...
    So the 3 pieces of informtion you need is Objects 'Speed' ( pixels moved per Frame ), its 'Direction' ( preferably an Angle ) and the amount of 'Time' of your choice.

    If you are using a Customized movement, you should know what 'Speed' and 'Angle' your Object is moving at, example:

    EVENT
    +Allways
    - Set Object Xpos = Object Xpos + Cos( Angle ) * Speed
    - Set Object Ypos = Object Xpos - Sin( Angle ) * Speed
    ( The above Event moves Object at a Speed in a Direction/ Angle )

    If you are using one of the Built-In movements ( selectable from the Objects properties, like 'Platform Movment' or 'Bouncing Ball' ), the 'Speed' value of these movements does NOT represent how many pixels they move per Frame, which is problematic in this case where we want to predict the object future possition and we need to know the Object 'Speed' ( pixels moved per Frame ) and its 'Direction' ( preferably an Angle ).
    This is why i asked what movement you were using.

    There probably is a corelation between the 'Speed value' of the build-in movement types and 'pixels moved per frame', and it shouldt be too hard to find this corelation.
    If you are using the built-in movement types i could try to find this corelation, if you dont want to have a stab at it.

  5. #5
    No Products Registered

    Join Date
    Dec 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It takes 16 ms for something to pass through the window when it's speed is set equal to the amount of pixels it has to travel.

    This is only when the timer starts when the object comes into frame and stops when the object comes out of the frame.


    It's not exact every time but I think this is good enough for what I have to do, I'll just have to do more tests with these numbers.

  6. #6
    No Products Registered

    Join Date
    Dec 2015
    Posts
    6
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Turns out it doesn't actually matter. Just gotta make sure that when you are timing it that you start and end the timer at the right times.

Similar Threads

  1. Total movement speed
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 25th March 2012, 09:36 PM
  2. movement speed
    By jaaj302005 in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 21st October 2011, 11:04 AM
  3. Get movement speed?
    By Atom in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 4th November 2008, 07:30 AM
  4. Path movement speed
    By Nickydude in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 14th May 2007, 11:25 PM
  5. Problem with the speed of a movement
    By CYMCASS in forum The Games Factory 2 - Technical Support
    Replies: 1
    Last Post: 1st May 2007, 07:04 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
  •