User Tag List

Results 1 to 10 of 10

Thread: Distance Meter

  1. #1
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Distance Meter

    ciao.
    I would like to add a counter that measures the distance reached by a ball thrown
    How can I do?
    There is specific meted ?
    Alex

  2. #2
    No Products Registered

    Join Date
    Jan 2010
    Location
    France
    Posts
    65
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    It's prety easy ^^, jsut store the X, Y original position and do mathematics : Sqr((xB-xA)▓+(yB-yA)▓)

    xA and yA are originals positions
    xB and yB are positions of your ball

  3. #3
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    Just for information, the formula provided by Pgm_snipe is Pythagoras' theorum, also known as the "distance formula". What you are calculating is the "hypotenuse" of a triangle where the length of the two sides you know are opposite and adjacent to the hypotenuse.

    It's worth having read so that formulae like this are understood.

  4. #4
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    ops....can you explain me how to put it step by step....

    i don't understand "just store the X, Y original position and do mathematics : Sqr((xB-xA)▓+(yB-yA)▓)"

    grazie

  5. #5
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    xA is the original X
    yA is the original Y

    xB is the target x
    yB is the target y

    So if the start position of the ball is 80,90 and the end position is 100,150, the distance between those two points is calculated as follows:

    Sqr((100-80)▓ + (150-90)▓)

    or

    Sqr((100-80)*(100-80) + (150-90)*(150-90))

    The Sqr function calculates the square root of the calculation in the outside brackets.

    Watch the video at the link below and consider that you know the lengths a and b because you know the coordinates of the points at the end of lines a and b. You then use Pythagoras' theorum to calculate C which is the distance between the start and end points of your ball.

    http://www.pythagorastheorem.co.uk/

  6. #6
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    i don't think it is right....
    please check it : example

  7. #7
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    Quote Originally Posted by videogiochi
    i don't think it is right
    You don't think what is right?

    Can you explain where the problem lies before I download your file?

  8. #8
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    I did a test file.
    I just wanted to know if it was good ....

  9. #9
    Clicker Fusion 2.5 Mac
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)iOS Export Module (Steam)

    Join Date
    Sep 2008
    Location
    Western Australia
    Posts
    256
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    Quote Originally Posted by videogiochi
    I did a test file.
    I just wanted to know if it was good ....
    You said you didn't think it was right; was there anything in particular?

    When learning something like this, it is best to set up a test system. e.g. create two objects where you know the distance between them, then use your formula to check the results. That way, you don't need to upload files for other people to check unless you have a specific problem that you can't fix and need help with, in which case, you can state the problem, explain the tests that you have carried out, and then someone else can have a look in order to help you.

  10. #10
    Clicker Fusion 2.5SWF Export Module
    videogiochi's Avatar
    Join Date
    Jun 2010
    Location
    italy
    Posts
    152
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Distance Meter

    ok, I'm sorry.
    Now remove the file from my ftp.
    thanks for your support
    Alex

Similar Threads

  1. Help with level up meter
    By Outcast in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 26th November 2013, 05:28 PM
  2. Audio Meter
    By FinalSpecimen in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 24th April 2013, 12:53 AM
  3. Custom Life meter?
    By JaJitsu in forum Multimedia Fusion 2 - Technical Support
    Replies: 12
    Last Post: 14th May 2009, 11:47 PM
  4. Metroid Energy Meter Example
    By Strider in forum File Archive
    Replies: 4
    Last Post: 24th October 2007, 08:57 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
  •