User Tag List

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

Thread: How do you create Z-Axis Projectile Movement?

  1. #1
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do you create Z-Axis Projectile Movement?

    So not long ago, I inquired on how to make a custom 8 directional movement for a project I'm working on, and a scholarly gentleman helped me out on some pointers! Only, now I'm needing to figure out how to incorporate a custom projectile movement which will raise and fall based on altitudes of what's firing versus what's being fired at (said altitudes stored in an Alterable Value of course).

    Quote Originally Posted by schrodinger View Post
    You have to store your Xpos and Ypos as alt. values and operate sin-cos calculations on that,
    X and Y object's positions are pixel integers and won't work well with decimal operators (sin_cos)


    start of frame >>
    set Xpos_Val to X position
    set Ypos_Val to Y position

    on movement >>
    set Xpos_Val to Xpos_Val + (speed*Cos(angle))
    set Ypos_Val to Ypos_Val - (speed*Sin(angle))
    set X position to Xpos_Val
    set Yposition to Ypos_Val
    So now I need to have an altitude check that will also affect projectile speed (like, if something's shooting straight up, then there should be no X or Y speed for example) and be able to calculate how much to gradually lift or drop said projectile in order to hit whatever's being aimed at.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Thanks for the gentleman

    This may be not so straightforward,
    or completely straightforward, depending mainly on this:

    you want a straight-line between projectile and target,
    or a "parabolic" kinda "esteem" from starting to end position based on projectile speed, starting angle, gravity...?

    (Please tell "straight-line" )

  3. #3
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    =P

    Straight line is what I'm going for at the moment. Bullet's for now. Point A to point B. Although I may eventually add in something like guided missiles, especially for a particular weapon I'm going to be adding down the line.

    Although I also plan on having said bullets be... quite fast, but if it can work for any given speed, that would be dandy!

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Since you also want high speed,
    I would suggest looking at this example:
    http://community.clickteam.com/threads/93553-The-exact-coordinates-of-the-collision-bullets

    Having higher speeds without fastloops may easily end up in wrong collision detection.

    As long as your code won't include hundreds of bullet at the same time, this should be fine.

  5. #5
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ahh. Well I'm less needing to know about the speed and collisions and more about just getting the Z-axis to work. Namely, how much to raise or lower a projectile sent towards objects with altitudes based on an Alterable Value, and slowing down X/Y speed accordingly, while also limiting how much the Z-axis would raise and lower based on the same maximum speed (for instance, raising and lowering as fast as, and up into, the max speed of a projectile if all objects were at the same altitude).

    This is of course for something isometric in the works, using the invisible layer method.

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Oh, wait... you're talking about isometric trajectories?
    That's a completely different situation then

    So you have already calculated X-Y axis trajectories, to make bullet follow straight isometric directions,
    and you want to alter this trajectory with an additional "Z" axis perpendicular to the ground,
    so to make them resemble going vertically up/down?

    Could you provide a little sketch or something to clarify?
    May be a challenging task, however, don't know if I would be up to it

  7. #7
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's actually easier than it sounds since I'm working with the invisible layer. I have objects that use a custom 8-direction movement on the invisible layer, and on visible layers, there are objects that correspond with their invisible counterparts to mimic the 2:1 ratio of isometric perspective. Altitude is currently handled by an Alterable Value.

    Set X position to X( "Invisible Object" )
    Set Y position to ( Y( "Invisible Object" ) / 2 ) - Altitude( "Invisible Object" )

    That's been working swell so far. What I need now is something that can adjust the Altitude and X/Y speed of a traveling bullet object when being shot from one Invisible Object at another, which have differing Altitude values.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    I guess some trigonomerty should do the job then,
    but since I'm not comfortable with this invisible layer setup (seems a clever idea!)
    I can't delve too deeply in the argument.

    I *think*
    you should basically replicate what you already do with X,Y positions,
    and substitute in your calculations "X with Y" and "Y with Z"
    (think of looking at the scene from a side: Z axis is vertical position (screen Y), Y axis is horizontal position (screen X ))

  9. #9
    Clicker Fusion 2.5

    Join Date
    Sep 2006
    Posts
    281
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: How do you create Z-Axis Projectile Movement?

    Sadly, when it comes to looking at it like that, that's when I just plain don't get it. But I'll attach what I mean when I'm referring to the invisible layer.

    MessingAround.mfa

  10. #10
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export Module
    Fusion 2.5 (Steam)
    schrodinger's Avatar
    Join Date
    Nov 2014
    Posts
    3,159
    Mentioned
    28 Post(s)
    Tagged
    1 Thread(s)
    Very nice!
    Here's a quick code for a projectile (press spacebar):

    MessingAround_1.mfa

    If you clarify how you would like to make it change its height we could try something
    (you basically just should alter projectile "height" value anyway...)


    EDIT: now I remember you were asking to adjust trajectory between two objects at different heights
    here's what you could try:
    -calculate the angular difference between the two objects (ATan2 (Z2-Z1,Y1-Y2))
    -move the bullet with the code you're already using (or the one I wrote in the example) and
    instead of altering X-Y coordinates, you should alter only height value by sin(angular_difference) * bullet speed

    Just as an untested idea, unfortunately I don't have the time to test right now

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Replies: 9
    Last Post: 23rd May 2015, 12:08 AM
  2. Beam Projectile?
    By Pixzel in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th August 2010, 11:02 PM
  3. Help lobbing a projectile
    By mobichan in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 22nd January 2010, 04:32 PM
  4. Targeted projectile flying a curve
    By Random in forum File Archive
    Replies: 9
    Last Post: 7th January 2009, 02:46 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •