Flip animation horizontally - Help with logic please!

Hi All,

I'm a Game Salad newbie and I'm having a bit of trouble flipping a character to turn and face the different direction when left/right key is pressed.

I've tried a few combinations but I can't quite get it to work!

Could someone please help with the logic please?

Here's what I've tried to turn and face and walk left (please forgive any slight discrepancy as typing this on my phone from work!)

1) set up a new rule that when the right arrow key is down
2) set attribute up in self.graphic.fliphorizontal = false
3 set a change attribute behaviour up that self.graphic.fliphorizontal = true
4) I add the move attribute here
5) I add the animation here

I can get the animation to work and the character to move left and right whilst animated, but i just can't get the character to 'flip'

Any ideas please? I think if someone can figure this out so that I can work out how the logic works in Gamesalad then hopefully I'll be good to go!

Many thanks,
Chris

Comments

  • ToqueToque Member Posts: 1,187

    You have right arrow key down self.horizontal.flip. False?

    I'm not at my computer either. I would try switching right key false and left key true.

  • ToqueToque Member Posts: 1,187
    edited October 2016

    I will send a test project that I think will make sense. I guess my next question. Is there any other states of movements? What does the object do when neither right key or left key is pressed?

  • chrisrowley1981chrisrowley1981 Member Posts: 5

    Thanks Toque, but sorry to be a pain but I can't view that youtube video. It says it is private?

  • smurftedsmurfted Member, PRO Posts: 570

    I'm also getting a private video story..

  • ToqueToque Member Posts: 1,187
  • chrisrowley1981chrisrowley1981 Member Posts: 5

    Thanks Toque, I'm not back home until tomorrow afternoon now to try this, but I will be sure to come back and reply after I've tested it.

    Many thanks for your help
    Chris

  • RowdyPantsRowdyPants Member Posts: 465

    @chrisrowley1981 Hey Chris, here's how I do it.

  • chrisrowley1981chrisrowley1981 Member Posts: 5

    Thanks RowdyPants,

    Likewise, as soon as I can test it tomorrow I'll be sure to post to feedback :smile:

    Thanks
    Chris

  • RowdyPantsRowdyPants Member Posts: 465

    @chrisrowley1981 This version has an idle animation to toggle between standing and running.

  • chrisrowley1981chrisrowley1981 Member Posts: 5

    Thanks to you both for the suggestions, really annoying I've checked mine after looking at your demos and realised the error was because I had 'True' and 'False' and not lower case 'true' and 'false'!!! Oh well, lesson learned!

    Thanks for the help guys, much appreciated!

Sign In or Register to comment.