Touch rule

LBGLBG Member Posts: 277
edited November -1 in Working with GS (Mac)
Hi all,

I am having a bit of a problem with the touch rule. In my game, when you touch an actor and all of the other rules are right you don't lose any lives. This works fine if I touch and release with my finger on the screen but if I touch and leave my finger on there, when the other rules become untrue you lose a life.

Is there an issue with touch in this way or is there something in my logic not quite right?

Any help would be great as I've been chasing my heels with this for a while now.

Cheers,

LBG

Comments

  • LBGLBG Member Posts: 277
    Heres my logic:

    When all:
    Actor receives event touch is pressed + game.presentType /= (I'll use this for not equal) 1 + game.PresentDropPrompt = true
    change attribute:
    game.lives to game.lives-1

    "presentType" is an integer from 1-6 that is created when the player character overlaps with a marker in the game. "PresentDropPrompt" is an attribute that becomes true when the player character overlaps with these markers. It tells the player to press the corresponding actor. It is these 6 actors that have the above rule, each with a different number in the game.presentType /= section of the rule.

    I need the rule to remove a life if the player doesn't press the right actor while the player character is overlapped with the marker.

    I hope that makes sense.

    Thanks

    LBG
  • MotherHooseMotherHoose Member Posts: 2,456
    ≠ (optionKey + =Key)

    perhaps separating your rule conditions

    Rule
    when touch is pressed
    ---Rule when game.presentType≠1
    ----Rule when game.PresentDropPrompt=true
    --------change game.lives to game.lives-1

    I would use an Index type attribute rather than an integer type for the player character...
    (works like a one column array... and IMO computers think of integers as bytes to use operants on)

    MH
  • LBGLBG Member Posts: 277
    Thanks MotherHoose. I managed to fix it in the end. I had to make sure that the other rules could only be true while game.buttonpressed was true. If they became untrue while game.buttonpressed was true then it triggered the rule as if they were all true.... Is that odd or is my understanding of how that works off?

    Cheers

    LBG
Sign In or Register to comment.