User Tag List

Results 1 to 4 of 4

Thread: Opposite conditions don't work together

  1. #1
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    Dec 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Opposite conditions don't work together

    I am trying to make a button behavior that is latching - that is, it stays pressed until pressed again. The button "not pressed" image is in the right direction, while the button "pressed" image is in the left direction. I have two lines to handle this action:

    Condition: Click on the button + button direction = right
    Action: Change button direction to left

    Condition: Click on the button + button direction = left
    Action: Change button direction to right

    I have attached the file. Any input is appreciated.

    Thanks -

    Brian
    Attached files Attached files

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS 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)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Considder the following

    Allways -> Set Counter to 1
    Allways -> Set Counter to 2

    What will the Counter display?
    It will allways display 2, as it is first set to 1, then 2, then the screen uppdates ( after running all the code )

    Click + Dir = Right
    -> Set Dir to Left

    Click + Dir = Left
    -> Set Dir to Right

    The top Event goes first, and assuming Dir is Right, it sets the Dir to Left.
    Then the secount Event goes, now the Dir is Left, and so it set the Dir back to Right again.
    ^ When you run the applicaion, it 'appears' nothing has happened, but this is programming logic

    ...
    There are 2 ways to work around this

    #1

    Click
    -> Toggle Flag0 ( this flips the Flag between 0 and 1, like a switch )
    -> Set Dir to Flag * 16 ( as Dir0 is Right, and Dr16 is Left )

    #2
    You could gain greater controll over the mouse input, but creating code that only lets there be 1 'Mouse Click' per Game Frame like this ( which in my mind is actually more logical, but it depends )

    Allways
    -> Set Counter to 1 ( This has to be at the very top of the Event Editor )

    Click + Dir = Right + Counter = 1
    -> Set Dir to Left
    -> Set Counter to 0

    Click + Dir = Left + Counter = 1
    -> Set Dir to Right
    -> Set Counter to 0

    ^ One could say we are kind of 'overriding' the Mouse Clicks, now only one Click can ocurr at a time

    ...
    On the subject of overriding the Mouse ( this is beside the original topic of this post ), the default 'Mouse click' is kind of slow maybe because its using the systems/ OSs definition of a Mouse Click.
    If you have

    Click
    -> Add 1 to Counter

    ^ You can click 20 times in rappid sucession, and the Counter will only go up by 5 -10 or so ( there is a sort of cooldown between each Click )

    Here is how to make Mouse Clicks respond on every Click.

    Repeat While Mouse is Clicked + Flag0 = 0 ( this has to be at the top of Event Editor )
    -> Set Flag0 to 1
    -> Set Counter to 1

    Mouse is overlapping Object + Counter = 1
    -> Set Counter to 0
    -> Action

    Repeat While Mouse is NOT Clicked + Flag0 = 1 ( this has to be at the bottom of Event Editor )
    -> Set Flag0 to 0

    Allways ( this has to be at the bottom of Event Editor )
    -> Set Counter to 0

    ^ I used 1 Flag and 1 Counter in the example so it would be easier to differenciate between the two. Now every click will be registered and you can click as fast as you want. I guess Flag0 represets the Mouse Button being held down, and Counter represents a single Mouse Click.

  3. #3
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    Dec 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I will try option #2. Many thanks for taking the time to respond and help me out!

    -Brian

  4. #4
    Clicker Fusion 2.5HTML5 Export Module

    Join Date
    Dec 2014
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Worked perfectly. Many thanks!

Similar Threads

  1. Change Item to the opposite way
    By Perry in forum Fusion 2.5
    Replies: 4
    Last Post: 24th June 2015, 11:49 AM
  2. Mouse conditions don't work properly in HTML
    By MTCMusic in forum HTML5 Export Module 2.5
    Replies: 3
    Last Post: 2nd August 2014, 07:43 AM
  3. iOS VIDEO OBJECT bug (conditions work under windows but not in iOS system)
    By unit102 in forum iOS Export Module Version 2.0
    Replies: 2
    Last Post: 16th May 2013, 05:17 PM
  4. [Bug 33] Negate Conditions Not Work
    By kiko in forum Android Export Module Version 2.0
    Replies: 4
    Last Post: 14th September 2012, 05:17 PM
  5. create opposite direction
    By thewreck in forum Multimedia Fusion 2 - Technical Support
    Replies: 13
    Last Post: 3rd July 2006, 05:01 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
  •