– Touch released problem – example project included –

LumpAppsLumpApps Member Posts: 2,881
edited March 2012 in Working with GS (Mac)
Hi there,

I am having problems with something. I'll try to explain it as simple as possible. I appreciatie your help.

I have a rule which has a when touch is released condition in actor 1.
- change alpha to 0

In this rule (!) there is another rule with another condition:
when game.attributeX = 1
- change alpha to 1
- change game.attributeX to 0

Then I have actor 2.
This has the following when touch is released condition:
- change game.attributeX to 1

Now when I click actor 1 it changes actor 1 alpha to 0
Great!
But, when I click on actor 2, actor 1 turns back to alpha is 1
IT SHOULDN'T because actor 1 does not get a touch released condition.

I have the file here so you can see what I mean.

If there is someone who knows an easy way around this please help me out. I need a function like this to work for a complexer set of rules.
Took me half a day to narrow my problem down to this. Pfew!

http://dl.dropbox.com/u/21686348/ReleaseBug.gameproj.zip


Comments

  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    Yeah this has been happening to me..
  • LeonardDeveloperLeonardDeveloper Member Posts: 4,630
    edited March 2012
    @ludwigheijden
    I think I have a fix.. Is this what you want: if it is.. Ill send you the fixed project file..
  • Rob2Rob2 Member Posts: 2,402
    It is how it should be. Once touch is released it exists as a state until a new pressed overrides it.
  • LumpAppsLumpApps Member Posts: 2,881
    Hi @LeonardDeveloper Does it do nothing when you click on the second actor? It should not turn it on again... I can't see in the video.

    @Rob2 Okay, I didn't know. I thought it only counted the moment I released.
    So how can I make actor 1 not change his alpha when actor 2 is released...

    Thanks both!
  • POMPOM Member Posts: 2,599
    edited March 2012
    What i do is make a "tap recognition"
    This is my way of doing this :
    In your actors make a self attribute - boolean - call it "I've been touched"
    Now make a rule :
    When touch is PRESSED
    Change "self.I've been touched" TO true
    Timer after 0.2 sec (RUN TO COMPLETION)
    Change "self.I've been touched" TO false

    Now another rule
    When "self.I've been touched" IS true
    When touch is released
    BLA BLA BLA (here put everything you have in your touch released)

    Photobucket Roy
  • LumpAppsLumpApps Member Posts: 2,881
    edited March 2012
    Thanks @P-O-M I will try that.
    (Might be after the weekend though, I'm about to call it a day)
  • LumpAppsLumpApps Member Posts: 2,881
    @P-O-M Your solution works. I saw you answered a simular question later.

    Funny thing is I've been using GS almost every day for over a year and never realized the touch release function wasn't a momentum thing but a constant state.

    @P-O-M this @ thingy doesn't work on your name ;(
  • GLGAMESGLGAMES SingaporeMember Posts: 988
    Yuh touch release means not touch in gs lolz. They should fix that.
Sign In or Register to comment.