User Tag List

Results 1 to 5 of 5

Thread: Get coordinates of a point when it reaches Y value

  1. #1
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    marius's Avatar
    Join Date
    Dec 2015
    Location
    Oslo, Norway
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Get coordinates of a point when it reaches Y value

    Hey all, I have some math troubles again.
    I am launching an object in a direction, and its gonna move until it reaches a certain Y value. I can use events to avoid the math in this, and just do a for-loop and check every pixel moving is Y position equals the Y position I want (which I think is really unprofessionally), but I would like to know the math so I can do this calculation in 1 event.

    Here is an illustration:


    So basically, if the object is at position (400,400) and its gonna move in the 135 degrees direction until Y position is 100, how can I predict X?

  2. #2
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    The expression to finding "Position I need to know"'s X relative to Start Position of object's X is simply:

    ( ( ObjectY - Y Value ) * 1.0 / Sin( 180 - Angle ) ) * Sin( Angle )

    EDIT: Example attached
    EDIT: Woops, apparently it's always 135 degrees, no matter what you change the angle to
    Attached files Attached files
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  3. #3
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    marius's Avatar
    Join Date
    Dec 2015
    Location
    Oslo, Norway
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ah, shoot, it looked right! Yes, the 135 degrees may wary..

  4. #4
    Clickteam Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleInstall Creator Pro
    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)
    BartekB's Avatar
    Join Date
    Aug 2013
    Posts
    667
    Mentioned
    14 Post(s)
    Tagged
    0 Thread(s)
    This time I got it right, it's:

    ( Tan(180 - Angle ) * (ObjectY - YValue ) )
    Attached files Attached files
    - BartekB, a.k.a Uppernate
    Join the Click Converse Discord! - https://discord.gg/R3WuvF3mHr

  5. #5
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleSWF Export Module
    marius's Avatar
    Join Date
    Dec 2015
    Location
    Oslo, Norway
    Posts
    51
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, this is right!
    Thanks a lot

Similar Threads

  1. Angle between 2 floating point coordinates?
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 19th June 2012, 03:12 AM
  2. Coordinates +1 movement, move to specifies point
    By ASD in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 22nd December 2009, 11:16 AM
  3. Remove first No# objects when count reaches limit
    By ionside in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 9th August 2009, 12:15 AM
  4. Help! - Moving from Point A to Point B - arched.
    By Conno in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 23rd April 2008, 07:15 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
  •