Help with on screen controls!!

cbowers428cbowers428 Member Posts: 176
edited November -1 in Working with GS (Mac)
BACKGROUND:
I have an actor who can move left and right. I have a left and right button on the screen. I also have a game text attribute that changes to "left" "right" or "none". When touch is pressed or inside the left arrow, the text attribute is changed to "left" of course, and the same goes for the right arrow. When released it is changed to "none" and the actor stops moving.

HERES THE ISSUE:
If somebody is holding the right arrow, then simultaneously presses and releases the left one (but is still pressing the right one) the actor stops moving. I think I know why. When touching the right arrow the text is changed to "right". Then when the left is pressed the text is changed to "left". But when the left is released the text changes to "none".

HERES THE QUESTION:
How can I fix this?

Comments

  • cbowers428cbowers428 Member Posts: 176
    bump sorry
  • cbowers428cbowers428 Member Posts: 176
    bump again i really need some help on this
  • simo103simo103 Member, PRO Posts: 1,331
    I believe you might want an attribute for left and one for right so you can compare the states of each and only if both are set to the released value would the motion rule stop. That way you could also determine what to do if both left and right are pressed by having the first assigned take precidence until released.
  • cbowers428cbowers428 Member Posts: 176
    It isn't working could you elaborate?
  • cbowers428cbowers428 Member Posts: 176
    thanks for ur time/help but this isn't really what i mean, basically i need it so you can press and hold left, then while holding left press right and go right, then when you let go go left (since your finger is still touching left)
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    That doesn't even make sense you need to give a better explanation of what you are trying for.
  • cbowers428cbowers428 Member Posts: 176
    Okay here we go. I have a left and right icon in my game which controls an actor. There is a game text attribute named CONTROLS. The text initially reads "none". When left touch is pressed or inside, the text in game.CONTROLS changes from "none" to "left". When it is released the text changes from "left" to "none". When right touch is pressed or inside, the text changes from "none" to "right". When it is released the text changes from "right" to "none". In the actor, when game.CONTROLS is "none" he doesn't move, when game.CONTROLS is "left" he moves left, when game.CONTROLS is "right" he moves right.

    Here's my issue.

    Note: I am using two hands/fingers to play.

    If I am touching AND HOLDING the right button (changing game.CONTROLS to "right" thus moving my actor right), and then touch the left button with my other finger while still holding down the right button (changing game.CONTROLS from "right" to "left") my actor goes left. HOWEVER, if I lift my finger off of the left button but I am STILL holding the right button, my game.CONTROLS attribute is changed from "left" to "none" instead of "left" to "right".

    I want the attribute to read "right" due to the fact that the touch is inside of the right icon.
  • quantumsheepquantumsheep Member Posts: 8,188
    Take off the 'and inside' thing from your buttons. All you need is 'when touch is pressed'.

    That might help.

    QS :D

    Dr. Sam Beckett never returned home...
    Twitter: https://twitter.com/Quantum_Sheep
    Web: https://quantumsheep.itch.io

  • cbowers428cbowers428 Member Posts: 176
    yea i've tried both and they don't work, this is a very strange issue
  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    First definitely take the touch is inside out of your rule. just when touch is pressed and then add in when control is none as a requirement. that way left wont work when right is down and right wont work when left is down. It makes no sense you would push both directions at the same time so that shouldn't be an issue to use a rule like that
Sign In or Register to comment.