User Tag List

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

Thread: Jetpack Style Movement With Physics help requested.....

  1. #1
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    scottige's Avatar
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jetpack Style Movement With Physics help requested.....

    The best way to show the sort of thing I'm trying to do is just to post a vid.....

    http://www.youtube.com/watch?v=jT4gzLAryCs

    I'm trying to do something similar to the Spectrum Classic Jetpac with a physics object.
    I can't seem to find a way to manipulate the x and y force independently of each other.

    What I'm doing at the moment is trying to manipulate an object with static physics movement.
    Now I may be going about this totally wrong so some help would be really appreciated.

    In MMF2 this is simple with a quick custom engine and would be the same in 2.5 but I want to utilize a physics object so I can interact with the world accordingly.

    Can any one suggest what physics movement would be best to manipulate for this and what I should be trying to manipulate.
    Be it forces, impulses etc.....

    If someone could start me on the right path by advising the above, I could take it from there.

  2. #2
    Forum Moderator Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    Stephen's Avatar
    Join Date
    Aug 2008
    Location
    Montana
    Posts
    4,515
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You should check into Force and Impulse.
    _____________________________________________
    Nivram's Examples -Need extensions? Send me a PM.-


  3. #3
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    My suggestion is to try physics platform movement, then add the jet pack behaviour to it using apply impulse at a 90 upward angle. However I have raised a bug for impulse as it doesn't seem to be doing what it should be in this build.
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  4. #4
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    scottige's Avatar
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've tried force and impulse but the problem is you can only seem to apply the force or impulse in one direction.
    The ideal solution would be to apply an x force and a y force independently but if I'm moving up at 90 degrees and I want to push the sprite over to to the right at the same time the right direction overrides the upward motion and only moves right.

    I know you can select any angle to apply force to but this is really inefficient.
    Applying 2 forces independently would be ideal if anyone can suggest how to do that.

    It doesn't seem to work and I'm not sure if it's a bug or it just doesn't work like that?

  5. #5
    Clicker Fusion 2.5

    Join Date
    Dec 2006
    Location
    France
    Posts
    37
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Jetpack Style Movement With Physics help requested.....

    I had the same problem, my solution is to push the player up with impulse, and move the player to the left or right using relative position ( Like set position x to "X("player")+10" )
    I hope it can help !

  6. #6
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    scottige's Avatar
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I was gonna try that but was worried it would end up sinking into other objects.
    Does that interact with other object ok?
    Does that push other objects out the way ok?

    If it does then excellent, I'll go that route.

  7. #7
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I think the problem is a bug at present.

    With Impulse, if I read the help file correctly, is it should provide a one moment 'kick' of force to your object at a given angle. So you should be able to (for example) apply an upward impulse (90 degrees) at the magnitute required and then a horizontal impulse (0 or 180 degrees). However what I observe happening is that impulse just instantly sets the speed at a constant value at the last direction given which I believe is a bug. I have reported it on the bug tracker.

    The easiest way to see this bug is to create your own 'spaceship' type movement (like in asteroids). Give an active the static physics movement, some events and actions to rotate the active with key presses (can use torque or set the angle directly) and then an event to apply Impulse at the current angle of the active when a key is pressed. The active will fall with the gravity settings until you press your key to apply impulse, at which time gravity is removed and the object moves instantly at a constant speed in the facing direction (including down). What you should see is the object gradually changes speed with resepect to all the impulse forces applied to it in that one game loop.

    So the diffuculty you are experiencing I believe is due to this bug.

    The Apply Force action works, but force is for only one direction at a time and it will continue to apply that force every game loop until told not to do so anymore. You could potentially try this as a work around, but you could only use it to apply upward force in your example and you would have to reset force to zero when not holding the jetpack fire button. The physics platform movement would take care of moving left and right and you would have to put in some events to detect when you are walking and when you are flying, but as long as you don't need to apply force in any other direction it should work.
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    happygreenfrog's Avatar
    Join Date
    May 2011
    Location
    I.L.T.D.O.I.R (I.L.T.D.O.I.R's Location: The Dimension Of Infinite Recursion)
    Posts
    4,304
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    You can't use apply force or apply impulse for the physics platform movement, last time I checked. I know, it's annoying.

  9. #9
    Forum Moderator Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export ModuleMac Export Module
    AndyH's Avatar
    Join Date
    Jun 2006
    Location
    UK
    Posts
    1,445
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    You're right. That is odd, it is available for the other player physics movements. Here's something I would expect to work, using the 8 way movement instead (I could have used the static movement too), but due to what the impulse is doing you can only move left, right, thrust up or fall but not two or more at the same time :-/ fairly sure this is a bug as its not what I see when using physics elsewhere.

    Here's the file (cursor keys and CTRL key): https://dl.dropboxusercontent.com/u/...%20impulse.mfa
    Andy H @ ovine.net
    Awful Jokes - a new cartoon every day: http://awful.ovine.net/
    Ovine's games: http://www.ovine.net

  10. #10
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export Module
    scottige's Avatar
    Join Date
    Jul 2006
    Location
    Scotland
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, manipulating the physics with forces and impulses does seem pretty broke.
    If you're moving up and then you apply another force to go right, it shouldn't cancel out the upward motion.

    Is this the bug you have reported?
    I was gonna when I first discovered but don't wanna double up if you already have.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. Movement synchronization issues (physics spaceship movement)
    By SecondSons in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 24th January 2014, 10:52 PM
  2. Physics question! Making AI that uses Physics Platformer/Physics Static movement
    By Krim in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 13th December 2013, 03:19 AM
  3. Movement and Box 2D Physics
    By Captain_Harris in forum Multimedia Fusion 2 - Technical Support
    Replies: 15
    Last Post: 5th September 2011, 07:32 PM
  4. Movement Extension:Physics Platform Movement?
    By Iwantmyrpg in forum Extension Development
    Replies: 7
    Last Post: 27th November 2010, 04:37 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
  •