User Tag List

Page 1 of 2 1 2 LastLast
Results 1 to 10 of 18

Thread: setting an objects direction in 360 degrees

  1. #1
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    setting an objects direction in 360 degrees

    I am currently setting an object's direction to be equal to a variable, so that I can take advantage of MMF2's inherant 32 directions. (Example: if the var = 16, then the object's direction is set to 180 degrees.) This is great for most of my needs, but I am finding that for some things, I would like to have more angles to work with than 32. I imagine I should be looking at the Advanced Direction object, but it is confusing me a great deal.

    Ideally, I still want to be able to set the direction by reading the value of a variable so that it represents an actual degree value. (Example: if var = 180, then the object's direction is set to 180 degrees, var = 190, then object's direction is set to 190 degrees, etc)

    Is there a relatively non-complicated way to achieve this? :blush:

    Thanks,

    Mobichan

  2. #2
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    Instead of using directions, simply use 360 degree angles. Even better, in the HWA beta it supports float angles instead of integers for even more directions and accuracy.

  3. #3
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    Since I am using the Bouncing Ball movement, setting a direction is the simplest way to get movement for me right now. Setting angles seems to just rotate each object, but not control the direction it travels in.

    I am asking if there is a way to set up my directions to use angles? As for HWA, I'm not making this for the web, so sadly I can't tap into that.

  4. #4
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    You can control the direction your object travels using angles and simple trig. And I'm not sure if you understood what I meant by HWA, Hardware Acceleration, which just renders things differently, it has nothing to do with the web. You must be thinking of Java or Vitalize.

  5. #5
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    Sorry, for some reason I have it in my head that HWA = Vitalize. Oops... As for that "simple trig", I guess that is what I am asking for an example of.

  6. #6
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    All you need is:

    Set X to X("Active")+Sin(Angle("Active"))*Speed
    Set Y to Y("Active")+Cos(Angle("Active"))*Speed

    That makes it so that the object travels in the direction of its angle. You might have to add or subtract 90 from the angle to make it travel in the right direction.

  7. #7
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    Thanks. So since the speed is calculated from the Bouncing Bullet, do I still need to set it? Or is this method abandoning the movment setting (and I should be using a static movment)?

  8. #8
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    I'm not really sure what your doing in your application. The trig equations I mentioned before will make the object travel in a straight line if their angle is not changed. If your making a bouncing bullet, I don't think those would apply, depending on how it is set up.

  9. #9
    Clicker

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleXNA Export ModuleUnicode Add-on
    mobichan's Avatar
    Join Date
    Oct 2007
    Location
    Buffalo, NY
    Posts
    3,310
    Mentioned
    28 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    Here is my test file:

    bullet test

    The active group shows the simplest use of my directional code. I need to determine if there is a simple way to integrate the formulas you just posted.

    Sorry if I am asking too many questions, but I have trouble really understanding how to apply trig in this situation.

    Mobichan

  10. #10
    No Products Registered

    Join Date
    Dec 2006
    Posts
    1,332
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: setting an objects direction in 360 degrees

    I made an example a while ago on how to make custom guns in games. I took that example and stripped it down to what you need. Click to shoot and change the values to what you want. Range is how far the bullets spread out. There may be unnecessary things in the application because I basically just gutted it to what you need. The equation in the Shoot Loop line is the one that spreads them out: Angle( "Player" )+(value( "Angle Range" )/value( "N Of Bullets Per Shot" )*((value( "N Of Bullets Per Shot" )/2)-LoopIndex("Shoot")))

    Link: Gun Test

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Advanced Direction Object with 360 degrees rotation
    By loglady in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 22nd March 2013, 03:36 PM
  2. [Request] keyboard shutcut for setting an objects layer
    By seripa in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 18th February 2013, 10:51 AM
  3. [Request] Direction Calculator for 360 degrees
    By ASD in forum Extension Development
    Replies: 2
    Last Post: 28th July 2010, 07:32 PM
  4. Movement Setting with multiple objects bug
    By Brandon in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th March 2008, 08:30 PM
  5. Setting positions of moving objects
    By DavidN in forum File Archive
    Replies: 0
    Last Post: 11th September 2006, 10:34 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
  •