User Tag List

Results 1 to 4 of 4

Thread: X Speed Based on Distance

  1. #1
    No Products Registered

    Join Date
    Jul 2006
    Location
    Versailles, MO, USA
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    X Speed Based on Distance

    I am in the process of making a platformer but had a question about the X speed of a boss. The boss I'm working on will constantly try to jump on top of the hero during the fight.

    Therein lies my problem.

    I'm needing an algorithm that will increase the X (Horizontal) speed of the boss character the farther away the boss is from the hero character, and vice versa. (Slow the X speed if the hero character is closer). If you need a more detailed explanation, let me know.

  2. #2
    No Products Registered

    Join Date
    Jul 2006
    Location
    Versailles, MO, USA
    Posts
    29
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: X Speed Based on Distance

    Bump

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

    Re: X Speed Based on Distance

    That should be simple.

    * xpos of Boss > xpos of Player
    - Boss: set speed to (xpos of Boss - xpos of Player)/6.4

    * xpos of Boss < xpos of Player
    - Boss: set speed to (xpos of Player - xpos of Boss)/6.4

    I think something like that should work. Play around with it.

  4. #4
    No Products Registered

    Join Date
    Jun 2006
    Posts
    259
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: X Speed Based on Distance

    So, wouldn't his xspeed just be the distance formula but slightly modified to scale it to your needs?

Similar Threads

  1. How to increase or decrease the score based on the distance of the enemy?
    By daryuss in forum Multimedia Fusion 2 - Technical Support
    Replies: 7
    Last Post: 18th September 2012, 01:33 PM
  2. Volume based on distance
    By ELCGames in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 27th November 2010, 09:50 PM
  3. Realtime Zoom based on distance between objects
    By Anders in forum File Archive
    Replies: 33
    Last Post: 14th June 2009, 11:23 AM
  4. Different velocity based on distance?
    By N64Mario in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 23rd March 2009, 06:45 AM
  5. Volume Based on Distance
    By InsertNameHere in forum File Archive
    Replies: 5
    Last Post: 25th July 2008, 07:40 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
  •