User Tag List

Results 1 to 4 of 4

Thread: Making two objects move Opposite

  1. #1
    Clicker Fusion 2.5 (Steam)
    Mazerwulf's Avatar
    Join Date
    Dec 2014
    Posts
    34
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Making two objects move Opposite

    Hello! New time poster and fresh owner of Fusion 2.5

    I've been eating up all the tutorials and happy to see so many people helping each other. I do have a quick question on something I was not able to find just yet.

    I am working on a shooter. I have 2 ships on screen for player 1 to use. I would like the first ship to move in the directions the player is pointing (up is up, down is down) but I'd like the 2nd ship to do the opposite (Down is up, up is down) so that both ships are moving opposite of one another at all times.

    What would be the best way to go about this? I really appreciate it!!

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid 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)
    Popcorn's Avatar
    Join Date
    Jun 2006
    Location
    Norway, Bergen
    Posts
    2,350
    Mentioned
    12 Post(s)
    Tagged
    0 Thread(s)
    Hi and welcome!
    The best way to approach this would be to have the second ship as a dummyship with no movement (static) that only mirrors the mainship's positions.

    * Always
    - Dummyship: Set y position to frame height - Y( "Mainship" )

    Hope that's what you meant

    If you have an up animation and a down animation for both ships, you'll need another action for that as well.

    * Always
    - Dummyship: Set animation direction to Dir( "Ship" )+16

    Since an object can have 32 direction animations, we add 16 to get the opposite direction. This applies even if you have set it to only 4 animationdirections.

  3. #3
    Clicker Fusion 2.5 (Steam)
    Mazerwulf's Avatar
    Join Date
    Dec 2014
    Posts
    34
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    I appreciate the help! However when I type it into the code/calculation box, I get a Syntax Error...(however your suggestion did help me understand the calculation box better )

    (Using the plus/minus images as place holders as I test everything)


    Untitled.jpg

    Did I type something incorrectly?

    **EDIT**

    Didn't realize I had to also input "Frame height" as in the whole equation was "Frame height - Y"

    It works!! Thank you so much !

    However when I use the Event "LMB Launch Object from "Dummy Ship" in "Direction facing", since it is static, it only shoots to the right. It doesn't shoot in any other direction during movement.







    While I am here, one last quick question so I don't bog the forums...I would like it to shoot bullets. So I have it as

    "When player flicks LM, spawn bullet in facing direction"

    And that works beautifully, but it only shoots 1 object at a time and you can only shoot when said object hits something or goes off screen. How would I make it where I can shoot one after the other?

  4. #4
    Clicker Fusion 2.5 (Steam)
    Mazerwulf's Avatar
    Join Date
    Dec 2014
    Posts
    34
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Popcorn View Post
    Hi and welcome!
    The best way to approach this would be to have the second ship as a dummyship with no movement (static) that only mirrors the mainship's positions.

    * Always
    - Dummyship: Set y position to frame height - Y( "Mainship" )

    Hope that's what you meant

    If you have an up animation and a down animation for both ships, you'll need another action for that as well.

    * Always
    - Dummyship: Set animation direction to Dir( "Ship" )+16

    Since an object can have 32 direction animations, we add 16 to get the opposite direction. This applies even if you have set it to only 4 animationdirections.
    I cannot thank you enough, Popcorn. I was having issues getting my Dummyship to launch/shoot opposite of the MainShip but after reading your "Animation Direction" again, I figured that same equation can apply to Direction and to flip it, just subtract the 16.

    * Always
    - Dummy Ship: Direction to Dir("Mainship)-16


    Works beautifully! Thank you for this information.

Similar Threads

  1. Face one direction but move opposite
    By jaytmek in forum Fusion 2.5
    Replies: 1
    Last Post: 4th April 2014, 08:23 PM
  2. Making obstacles that move
    By ac3raven in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 20th July 2011, 02:15 AM
  3. How to place objects precisely opposite each other
    By vesperillo in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 28th August 2010, 07:13 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
  •