User Tag List

Results 1 to 4 of 4

Thread: Trouble getting object to invert color on/off

  1. #1
    No Products Registered

    Join Date
    Jul 2010
    Location
    Florida
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble getting object to invert color on/off

    Hi All,

    I am trying to make an application that will invert a brick's color when clicked. This I can do - no problem. But I want it to behave such that the brick color will go back to normal if the user clicks again. The problem is that the brick seems to not change at all - not sure why, but I think the routine runs so fast that it runs from inverted back to normal while a single click occurs.

    Can anybody help me with this one? Many Thanks!
    Attached files Attached files

  2. #2
    No Products Registered

    Join Date
    Jul 2010
    Location
    Australia
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Trouble getting object to invert color on/off

    Yes, it is running too fast. MMF2 runs so fast, that it interprets the one mouse click as two.

    Several ways of solving this...

    1. Set one of the mouse click actions to be right-click.
    2. Do this
    Code:
    --User clicks on brick with left mouse button
    +Timer >= 30 hundredths of a second
    +Flag 1 is off
    ==Brick invert color
    ==Timer set timer to 0 seconds, 0 hundredths
    ==Brick flag 1  on
    Then
    Code:
    --User clicks on brick with left mouse button
    +Timer >= 30 hundredths of a second
    +Brick flag 1 is on
    ==Brick color none
    ==Timer set timer to 0 seconds, 0 hundredths
    ==Brick flag 1 off
    That should do it. Hope it helps

  3. #3
    Clicker Multimedia Fusion 2 DeveloperSWF Export Module

    Join Date
    Jun 2006
    Posts
    6,773
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Re: Trouble getting object to invert color on/off

    It's nothing to do with speed. The event list is executed from top to bottom, once every frame. The brick changes colour, and then the next condition runs, changing the colour back.

    Using a timer to get around this is a horrible way to do it - just set something on (like flag 2) to indicate the colour was changed this frame, and check the flag is off before you change the colour. You then set the flag on "Always", before the two conditions.

    You could also use a group, like this:


  4. #4
    No Products Registered

    Join Date
    Jul 2010
    Location
    Florida
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Trouble getting object to invert color on/off

    Thanks Guys!

    I think I am slowly starting to get it. Sort of building a subroutine within the linear code, eh? Different from my C++ days, but I do like the coding structure - just a bit of a learning curve to get over . . .

    J

Similar Threads

  1. Platform Movement Object - Invert Gravity : not "Standing on Ground"?
    By Oreo in forum Multimedia Fusion 2 - Technical Support
    Replies: 1
    Last Post: 4th April 2013, 05:29 PM
  2. Invert blend
    By Looki in forum Shaders
    Replies: 0
    Last Post: 20th March 2010, 02:44 AM
  3. [Request] Invert Selection
    By Jaffob in forum Multimedia Fusion 2 - Technical Support
    Replies: 2
    Last Post: 27th April 2009, 08:58 PM
  4. Invert Zoom In picture editor
    By jasonorme in forum Multimedia Fusion 2 - Technical Support
    Replies: 5
    Last Post: 4th July 2006, 03:57 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
  •