User Tag List

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

Thread: Move in current direction ..how?

  1. #1
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Nov 2015
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Move in current direction ..how?

    (Sorry for making this thread, I have used search honestly but I didn't find the solution)

    Picture Combat for the Atari 2600 (ultra basic top down tank game)
    I have the tank, I have the rotate left/right set and working (repeat while 'x' is pressed - setangle to angle(tank) -2/+2 quality 1)

    But.. I cannot figure out how to make the tank move in the direction it is pointing in when you press the move key.
    really, I know it'll be something really simple, but I am so so very thick and stupid and take eons to learn the slightest thing.

    someone please put me out of my misery and tell me how to do it. (better still, maybe you should just tell me to uninstall fusion as I'm just too old and too stupid to use it.)

    Thank you

  2. #2
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    X = X+Cos(Angle)*Move Speed
    Y = Y-Sin(Angle)*Move Speed

  3. #3
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Forgot to add: make sure you use those formulas in alterable values, instead of directly setting your position to them.

    I.E:

    start of frame
    --> set values xpos to x, value ypos to y

    [[your code that changes the actual angle of the tank]]
    [[input, such as setting speed when a button is pressed, etc]]

    always
    --> set xpos to xpos+Cos(Angle)*Move Speed
    --> set ypos to ypos-Sin(Angle)*Move Speed
    --> set x to Round(xpos)
    --> set y to Round(ypos)

  4. #4
    Clicker Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Nov 2015
    Posts
    103
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I really don't understand it at all and I utterly failed maths when I was in school (so things like sin and cos are utterly alien to me) but I'll attempt to copy what you wrote into fusion.

    Thanks

    Edit:- I tried for 2-3hrs and couldn't get it to work, I'm sure the fault is mine and not yours though. Thanks for helping.
    (I'm doing to try some different software now, just to see if my brain will understand it any better than CTF. lol)

  5. #5
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Here's an example: tank movement.mfa

    You probably won't find a simpler/easier to understand program than Fusion out there. If you give up so easily you'll never make any progress no matter what you try, though. You don't need to understand any math to use what I said!

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export Module
    westron's Avatar
    Join Date
    Jun 2016
    Location
    Arizona, USA
    Posts
    48
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    casleziro's example is perfect because it gives you full control over the programming. There is another option which uses the one of the movements built into Fusion (Race Car movement) and just 1 event.
    1) Create an active object. On the bottom part of the window where you create the graphics for your object, you'll notice 4 cardinal directions and a black arrow pointing to the right. Directly below that is a small gray tab that you can slide; move it all the way to the right to increase the number of directions for your graphic (instead of 4 directions you should now see much more, 32 to be exact).
    2) The black arrow will still be pointing to the right by default. Draw your tank facing right, then click on the hot spot icon (looks like an eye, found with the drawing tools). Move the hot spot (target thing) to the center of the image. This sets the center of rotation for the graphic.
    3) After you draw the tank facing right, just right-click on the small black square for that direction and select "Create rotated directions." This should fill in all 32 directions with black dots (and rotates the image automatically).
    4) In the "Properties" window for this active object, click on the "Movement" tab (looks like a blue person running). Set the movement Type to "Race Car."
    5) In the Event Editor, add an event for "Player 1" (Joystick icon). Select "Joystick" → "Repeat while joystick pressed" (By joystick, they mean whatever input method the user has set... it's the arrow keys on keyboard by default.) Select the UP direction.
    6) Right click on the condition you just made and select "Negate" (this sets the condition to be, essentially, "If the user does NOT have the UP key pressed...")
    7) Create the action for the active object (tank) as "Movement" → "Stop"
    That's it! Try it out. I attached an example of this MFA.
    turnandmove.mfa

  7. #7
    No Products Registered

    Join Date
    Jun 2018
    Posts
    4
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    to casleziro
    I used your programming to create my tank's movement, but I can't figure out how to shoot in the tanks direction when it turns. Help would be much appreciated!

  8. #8
    Clicker

    Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Jun 2006
    Location
    Killeen, TEXAS
    Posts
    1,037
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    if you are using the built in direction movement, and using Angle's the DIR for the object ; then the DIR is the ( angle*11.25 ) this will help for people who just cant get their head around Sin/Cos

  9. #9
    Clicker Fusion 2.5Fusion 2.5+ DLC
    casleziro's Avatar
    Join Date
    Mar 2013
    Location
    United States
    Posts
    643
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    @rowdy hey, very simple to add.

    Make the turret its own active object, always positioned at the tank base. The turret will rotate towards your firing target (the mouse in most tank games), and fire bullets in this direction. The bullets use exactly the same formula to move as the tank base, only you set their movement angle once upon firing, so it doesn't change.

    Here's an updated example: tank movement with turret.mfa

  10. #10
    No Products Registered

    Join Date
    Jun 2018
    Posts
    4
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    @casleziro whenever I shoot a bullet at a backdrop, even though the bullet has a movement 'bouncing ball' it just phases through the backdrop and I can't find a solution. Sorry for bugging you at all these things, I don't know how to make games properly.

Page 1 of 2 1 2 LastLast

Similar Threads

  1. How do you get the opposite direction from current direction?
    By PotatoMerchantz5 in forum Fusion 2.5
    Replies: 11
    Last Post: 7th December 2015, 02:02 PM
  2. Face one direction but move opposite
    By jaytmek in forum Fusion 2.5
    Replies: 1
    Last Post: 4th April 2014, 07:23 PM
  3. object move in direction of a 360 angleplease help
    By diomdennis in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 13th September 2009, 05:30 PM
  4. object move in direction of an angle?
    By diomdennis in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 10th September 2009, 01:33 PM
  5. Making ball move to exact direction
    By Ryzzo in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 7th April 2007, 05:58 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
  •