User Tag List

Page 2 of 2 FirstFirst 1 2
Results 11 to 18 of 18

Thread: setting an objects direction in 360 degrees

  1. #11
    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

    The link seems down, so I'll try downloading later tonight.

    Thanks,

    Mobichan

  2. #12
    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

    Ok, its fixed. The link should work now.

  3. #13
    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 for the example. It makes me curious about using the Movement Controller more, since it has the ability to work with angles. Unfortunately (as with most examples) it uses the mouse pointer as one set of points in the equation. This will probably come in handy for future projects, but since I am using this for enemy bullets, I need to figure out a way to define a set of points that don't involve the player/mouse.

    Maybe I'm not approaching this the correct way, but I have a feeling I should somehow use the enemy's position and an arbitrary point in front of the enemy as a sort of "reference" point. Then at least I will have a starting angle to work from. I noticed the "Convert Direction to Angle" expression. Is it possible to set an initial direction with the standard 32 angles and then convert it to degrees, after which I can work solely in degrees? Or is that for setting the angle and not the direction? :confused: The distinction between the 2 terms is a little confusing.

    If only the standard MMF2 directions could have an option to support 32 or 360 directions. Sigh...

    Mobichan

  4. #14
    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

    It doesn't use the mouse to determine where to shoot. It uses the player's angle, which is exactly what an enemy would use to fire. There is no XMouse or YMouse in the equation. It should be easily adaptable to enemies.

  5. #15
    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

    It looks like the initial angle is set as a direction based on 2 points, one of which is the turret and one of which is the mouse x,y. Then that angle is used to determine the shoot direction. Or am I misunderstanding the equations?

  6. #16
    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

    Yes, you are misunderstanding the equation, I'll dissect it for you. The original equation is:

    Angle( "Player" )+(value( "Angle Range" )/value( "N Of Bullets Per Shot" )*((value( "N Of Bullets Per Shot" )/2)-LoopIndex("Shoot")))

    Angle( "Player" ) = Starts off the equation by providing a base angle for the bullets to fire in.

    (value( "Angle Range" )/value( "N Of Bullets Per Shot" ) = Spaces out the bullets when multiplied by the next part of the equation. Dividing the range by the number of bullets evenly spaces them out.

    ((value( "N Of Bullets Per Shot" )/2)-LoopIndex("Shoot"))) = This part is multiplied by the previous part. The reason the number of bullets is divided by two is so that half of the bullets travel above the angle of the player and half travel below. That alone wouldn't work though, because you have to subtract the Loop Number from it, and it loops the number of times that there are bullets, so half of them will be a negative number, and that is subtracted from the angle.

    It's a bit confusing, but I explained it the best I could. As you can see, there is no reference of mouse positions. The only thing in there remotely like Mouse Positions would be the angle part at the beginning. This doesn't require any input from the player and is completely set by the angle of the object shooting. So if the enemies travel based on angles, they can fire using this system. Even if they use simple 32 directions, simply dividing by 11.25 (360/32) would put it into 32 direction. The angle of the player is set by the mouse positions, as you can see when you move the mouse the player turns to face it. But if you set the angles for an enemy, you will not be setting it by the mouse and can still use the angles.

  7. #17
    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

    Brandon: This really helps me out quite a bit. I am definitely learning there are MANY ways to do the same thing. I actually was stuck on how to recreate this until I realized my bullet's movement was set to bouncing ball and yours was set to vector. It seems that the Bouncing Ball controls are not in the Movement Controller , so I might be out of luck with trying to combine both of our approaches into one system. But I might just use the things you've taught me for more complex enemies like bosses. All in all, thanks for spending the time to work with me on this.

    :grin:Mobichan

  8. #18
    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

    No problem . Glad I could help somewhat.

Page 2 of 2 FirstFirst 1 2

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
  •