Mouse is down with no Rules... bug?

gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
edited November -1 in Working with GS (Mac)
Hi, the following is a bit unexpected and I can't see why it's happening; and if it's not a bug, what's the purpose? (almost certain it's a bug though...)

I've 3 actors, their Rules include Text. A fourth actor is called Start, with when mouse is down, activate the first actor to count.

Clicking Start sets it all off fine; but so does clicking any of the other actors, but there's no "when mouse is down" Rule in any of them. I tried putting an empty rule in one of them but still it activates the count.

Anyone any ideas what's going on here please?

---------------------------------------------------------------
Spiral Gyro Apps

""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    I am not exactly sure what you are talking about, but "Mouse is Down" works everywhere on the screen.

    So if you have an actor with a Rule like this:

    Rule
    When all conditions are valid
    Mouse is Down
    -----[do whatever]

    That will actually work across the whole Scene. You can click anywhere on the screen to trigger that.
    To limit the Click or Touch just to the Actor itself, use either:

    Touch is Pressed

    or

    Mouse is Down
    Mouse is Inside

    I probably have misunderstood your problem though...
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Thanks firemaplegames, maybe I didn't explain myself properly, or I'm still not understanding.

    A simple test: 2 actors; 2 game attributes, boolean Start + integer seconds. In actor 1 the Rules are: when Actor receives event mouse button is down > Change Attribute game.Start To true.

    In the second Actor, the Rule is when Attribute game.Start is true > Display Text, game.seconds > Timer every 1 second Change Attribute game.Seconds To game.seconds + 1.

    I click on Actor 1, and off it goes just fine of course, counting up in seconds. But: if I Preview it again from the start, but this time click on Actor 2 – which has no mouse/touch rules at all; nothing about Start – it starts running.

    My reasoning is that, because the mouse down Rule is in Actor 1, surely "owned" by Actor 1, what's Actor 2 doing, starting up without any mousedown command in its Rules? And more to the point, starting even though Start is false.

    I can even make another blank-Ruled actor – or as many as I want, and if I click on any one of them, the Timer starts: with Start set to false, and no mousedown Rule in them... Just don't get it...

    ---------------------------------------------------------------
    Spiral Gyro Apps

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

  • firemaplegamesfiremaplegames Member Posts: 3,211
    If you are using 'Mouse is Down' as a condition for the Rule, it works ANYWHERE on the screen - not just on the Actor.

    As a test, try clicking anywhere on the screen, not even on any actor. It will still execute. Even if you click the other other actor, it will still execute.

    Change the condition of the Rule to be 'Touch is pressed'. So:

    Rule
    When All conditions are valid:
    Touch is pressed
    -----Change Attribute game.Start To: true

    If you need to use Mouse is down for logic reasons ( FYI, 'touch is pressed' will work fine with the moue, and 'mouse is down' still works on the device) then you need to add the 'Mouse is inside' condition as well.

    So:

    Rule
    When All conditions are valid:
    Mouse is down
    Mouse is inside
    -----Change Attribute game.Start To: true
  • gyroscopegyroscope I am here.Member, Sous Chef, PRO Posts: 6,598
    Thank you very much, firemaplegames; I got it second-time around! I guess that knowing that in at least three programs I know of, where buttons can be programmed, the code belongs to the button. In fact, as you know, in the majority of OOP, each bit of code inside its container, including fields, etc; the code belongs to that particular object. I don't know but I'd guess that in Xcode, being object oriented front-end, the same would apply?

    Most odd to me that GS doesn't follow this convention. But at least I know what's going on now; thanks again.

    :-)

    ---------------------------------------------------------------
    Spiral Gyro Apps

    ""You are in a maze of twisty passages, all alike." - Zork        temp domain http://spidergriffin.wix.com/alphaghostapps

Sign In or Register to comment.