User Tag List

Results 1 to 9 of 9

Thread: Flipping controls

  1. #1
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Flipping controls

    I've almost completed the coding of my platform game and I want to add a new feature, an item that flips controls for some 20 seconds.
    I could go back to the code (which is very complex) and add the feature, changing a lot of lines. But I wonder if there's an extension or another method of flipping the input controls directly, so that when the player presses left (on the keyboard or joystick) the runtime takes it as if it was right, etc.

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export Module

    Join Date
    Apr 2014
    Posts
    108
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The easiest way I can think of is to inject a multiplier into your movements. I don't know if you are using any custom plugins, but it should still work. Any time you are taking an input that changes x/y, multiply the result by a global value. The global value would be 1 under normal play, and set to -1 under reversed conditions. This due to the fact that multiplying by 1 yields the same number, and multiplying by -1 yields the negative version of the number.

    On Press Left: set X(Player) = X(Player)+(2*reverseMod)

  3. #3
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you.
    But that requires to modify many events. Is there an extension which can simulate an input (key or joystick)?

  4. #4
    Forum Moderator Fusion 2.5 DeveloperHTML5 Export ModuleiOS Export ModuleSWF Export Module
    DavidN's Avatar
    Join Date
    Jun 2006
    Location
    Boston, MA, USA
    Posts
    4,044
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The Control X extension can simulate key presses... but I think it would still have to sit in the middle of your events and you'd code around it, as it wouldn't stop the reaction to the original keypress (if simulating pressing Right when pressing Left, you would end up with both keys down).

    If you're using the default Player object for controls, is there a way to switch the keys for left and right temporarily from there?

  5. #5
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That's exactly what I'd like to discover. For the time being I've managed to find a workaround: I flip the entire screen with a flip shader so that the controls seem to be reversed!

  6. #6
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    BtheDestroyer's Avatar
    Join Date
    May 2013
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DavidN View Post
    If you're using the default Player object for controls, is there a way to switch the keys for left and right temporarily from there?
    You can do this with Control X. Just set the controls to opposite buttons when they should be flipped and set them back when they're normal again. This only requires 2 events and is much faster than changing every event that uses controls.

  7. #7
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure, but if the player had defined custom controls? If he manually set I / J / K / L for movement can I retrieve that J is for left and L for right in runtime and swap them temporarily, before reverting them to normal?
    And if the player chose to use the joystick?

  8. #8
    Clicker

    Fusion 2.5 Developer
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)
    BtheDestroyer's Avatar
    Join Date
    May 2013
    Posts
    99
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've made an example for you. If you touch the red object, you will get your controls flipped for a short time.
    Attached files Attached files

  9. #9
    Clicker Fusion 2.5 DeveloperFusion 2.5+ DLCAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-on
    Boba Fonts's Avatar
    Join Date
    Jan 2009
    Location
    Northern Italy
    Posts
    228
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for the example! It works very well with keyboard controls. But it does not affect the use of a joystick/gamepad.

Similar Threads

  1. Flipping a Image & Animation
    By Merrie in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 5th February 2015, 03:20 PM
  2. Flipping Screen
    By Corlen in forum iOS Export Module Version 2.0
    Replies: 3
    Last Post: 28th June 2012, 01:01 PM
  3. Configure controls (custom controls)
    By Leander in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 8th June 2010, 11:47 AM
  4. Flipping PNG files
    By Solidghost in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 21st January 2008, 06:58 PM
  5. Flipping hotspots and actionpoints.
    By Syp3r in forum Multimedia Fusion 2 - Technical Support
    Replies: 3
    Last Post: 18th August 2006, 07:53 AM

Posting Permissions

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