my brain is fried. flip horizontally works 1 way, but wont go back?

pjnolenpjnolen Member Posts: 152
edited November -1 in Working with GS (Mac)
I want to face my hero, left and right with the press of a button.
I have this on the hero actor.

"when touch is pressed, when attribute self.graphic.flip horizontally is true

change attribute self.graphic.flip horizontally to false"

which works fine
but if I do this

"when touch is pressed, when attribute self.graphic.flip horizontally is false

change attribute self.graphic.flip horizontally to true"

it won't flip back

What am I doing wrong?

Comments

  • tenrdrmertenrdrmer Member, Sous Chef, Senior Sous-Chef Posts: 9,934
    You can run into issues sometimes with two touch rule fliping attributeback and forth based on that attributes value.

    A better way to do this would be create an actor level integer attribute called FlipH
    And the 2 rules.

    When Touch is Press
    --Change self.FlipH to (self.FlipH+1)%2

    and

    When self.FlipH equals 0
    --Change self.Graphics.FlipHorizontally to false
    Otherwise
    ----Change self.Graphics.FlipHorizontally to true

    That will work perfectly I have even tested that out just to be sure.

    Good Luck
    Aaron
Sign In or Register to comment.