User Tag List

Page 1 of 3 1 2 3 LastLast
Results 1 to 10 of 24

Thread: Need help and opinion on tank game problem

  1. #1
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Need help and opinion on tank game problem

    Okay I uploaded a quick video to youtube to show what my issue is because its a lot easier if you can just see it. Anyway, I can't figure out how to animate the tank actually going up the slope. It doesn't angle upwards in its current state. I should also mention I'm using the PMO with it currently. Basically when the tank goes up the slope it stays the same angle as if its moving on flat ground.

    So I need to know how I might change that, and if it looks bad the way it is. Should I just say to heck with it and leave it like it is?

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

    I tried using detectors and changing the animation to an angle when on a slope, but that was extremely buggy and just didn't work properly.

  2. #2
    No Products Registered

    Join Date
    Oct 2009
    Posts
    480
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    I would just leave it the way it is and use more flat surfaces.

    -Variant

  3. #3
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Quote Originally Posted by variant
    I would just leave it the way it is and use more flat surfaces.

    -Variant
    Yeah that's another thing I considered. Just removing slopes altogether and making ledges/cliffs instead.

    I think I'm just going to leave the tank movement the way it is, because I can't come up with a bug-free way to fix that.

  4. #4
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Don't give up! :]

    I almost never use detectors unless they're absolutely necessary. I find that 90% of the time, a fastloop works much better.

    Here's what I would do:

    1.) Create two invisible objects. I'll call them wheel1 and wheel2.
    2.) At the start of each cycle, put wheel1 on top of the first wheel, and wheel2 on top of the second wheel.
    3.) Start a fastloop. The number of times you run this fastloop will relate to the maximum angle of your tank. For now let's just say you run the loop 100 times.
    4.) Each fastloop, move both wheels down 1 pixel.
    5.) During the fastloop, if a wheel is overlapping a backdrop, move them back up 1 pixel.
    6.)Now you should have two invisible wheel objects resting on the ground.
    7.)Set the angle of your tank to atan2(Y("wheel2")-Y("wheel1"), X("wheel2")-X("wheel1")) or something like that.

  5. #5
    Forum Moderator

    Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleUniversal Windows Platform Export ModuleSWF Export ModuleXNA Export ModuleInstall Creator Pro
    nivram's Avatar
    Join Date
    Jul 2006
    Location
    Bandon, Oregon
    Posts
    6,773
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Just curious...the "wheels" aren't detectors?

    Marv
    ​458 TGF to CTF 2.5+ Examples and games
    http://www.castles-of-britain.com/mmf2examples.htm

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Well I suppose in a sense they are. But I think that in the context of Clickteam products, "detector" implies an object that is always at a fixed position relative to another object, for the purpose of detecting collisions on a certain side of an object. The invisible wheels would be a little more advanced than a traditional "detector," because they are using fastloops to adjust their position dynamically depending on where the obstacles are.

  7. #7
    Clicker Fusion 2.5 DeveloperHTML5 Export ModuleSWF Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Fusion 2.5+ DLC (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jul 2006
    Location
    USA
    Posts
    2,982
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Quote Originally Posted by UltimateWalrus
    Don't give up! :]

    I almost never use detectors unless they're absolutely necessary. I find that 90% of the time, a fastloop works much better.

    Here's what I would do:

    1.) Create two invisible objects. I'll call them wheel1 and wheel2.
    2.) At the start of each cycle, put wheel1 on top of the first wheel, and wheel2 on top of the second wheel.
    3.) Start a fastloop. The number of times you run this fastloop will relate to the maximum angle of your tank. For now let's just say you run the loop 100 times.
    4.) Each fastloop, move both wheels down 1 pixel.
    5.) During the fastloop, if a wheel is overlapping a backdrop, move them back up 1 pixel.
    6.)Now you should have two invisible wheel objects resting on the ground.
    7.)Set the angle of your tank to atan2(Y("wheel2")-Y("wheel1"), X("wheel2")-X("wheel1")) or something like that.
    I have a system now that almost works, but I can't figure out the math :P How exactly do I find the angle between the 1st and 2nd wheel and have the tank change to that angle? Yeah... math isn't my strong suit.

  8. #8
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleSWF Export Module
    Game_Master's Avatar
    Join Date
    Jul 2007
    Location
    England
    Posts
    1,705
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    Take a look at the Zeb example on the second MMF2 CD ROM. It has him walk up and down ramps/slopes like you want to do here.

  9. #9
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    UltimateWalrus's Avatar
    Join Date
    Jul 2006
    Posts
    824
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    If you're using the latest version of MMF2, it should have the atan2 function which'll give you exactly what you need.

    The exact expression you should use looks something like this:


    Tank sprite --- Set Angle to:
    -1*ATan2(Y("wheel2")-Y( "wheel1" ), X("wheel2")-X( "wheel1" ))


    ATan2 is a function that takes an X/Y vector and uses the Tangent function to give you the angle (in degrees) of that vector. You always put the Y component first (because the tangent will be using y/x).

    The reason it's negative is that MMF's sprite rotation ignores the fact that +Y points down.

    Does that make sense?

  10. #10
    Clicker Fusion 2.5 Developer
    00J's Avatar
    Join Date
    Jun 2006
    Location
    Virginia, USA
    Posts
    1,510
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Need help and opinion on tank game problem

    The reason it's negative is that MMF's sprite rotation ignores the fact that +Y points down.
    Does that make sense?
    Is that so? Interesting. Why would this be the case? not logical? Or is it just not logical to us humans?

Page 1 of 3 1 2 3 LastLast

Similar Threads

  1. Game Cutscenes - Your opinion
    By Renatos in forum iOS Export Module Version 2.0
    Replies: 6
    Last Post: 26th April 2012, 11:22 AM
  2. Simple Tank Battle from templetes: Problem
    By scurvy in forum The Games Factory 2 - Technical Support
    Replies: 2
    Last Post: 18th February 2008, 03:58 AM
  3. Help with a tank game
    By AusZero in forum The Games Factory 2 - Technical Support
    Replies: 6
    Last Post: 4th June 2007, 02:55 PM
  4. Tank Game With Gravity?
    By Nicholas Martin in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 24th November 2006, 11:31 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
  •