L/R Animation with Movement Graphic Error

Hi Everyone! This is my very first post on the GameSalad forums, so try and be nice. =]

I am new to programming and GameSalad, but have watched a ton of tutorials and spent a lot of time reading through the forums. I am working on a simple game scene where my character can move left or right on the screen. While moving he should be animated so that it looks like he is walking. I have two invisible buttons on either side of the screen so that if you press on the right half he moves right, left, he moves left. I have everything working correctly except this this serious problem:

When the character is standing still, he flips between his standing pose, his right walking pose, and his left walking pose. It does this really fast so its just blurry and weird looking. It kind of looks like he is having a seizure. This is what I have so far:

Universal Attributes:
right - unchecked - boolean
left - unchecked - boolean

Player Attributes:
Grounded? - checked - boolean
FacingRight - checked - boolean

Timer - every 0.0 seconds - run to completion off
Rule:
game.right is true
game.left is false
Change self.Motion.Linear Velocity.X to 75
Rule:
game.right is false
game.left is true
Change self.Motion.Linear Velocity.X to -75
Rule:
game.right is false
game.left is false
change self.MotionLinear VelocityX to 0
Rule:
game.right is true
game.left is true
change self.MotionLinear VelocityX to 0
(These are all within the Timer Rule and he moves left and right just fine)

Rule:
self.MotionLinear VelocityX > 0
Animate (6 .png sprite images at 6fps, loop on, return actor on
Rule:
self.MotionLinear VelocityX < 0
Animate (6 .png sprite images at 6fps, loop on, return actor on

I even tried putting my two animate rules within the timer group and that made him stay on his straight on view, then when walking either direction, he switches between images so fast it looks all blurry as he walks. Any help you can give me is really appreciated. Please be patient with me since I am still learning the program.

Thank you!

Comments

  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    The problem is in your animation or facing rule. Check there.
  • chelseywood10chelseywood10 Member Posts: 2
    The problem is in your animation or facing rule. Check there.
    I'll try. But I am not sure what I'm looking for. Does it have to do with the timer that's checking every 0 seconds for input from the two buttons?

    Sorry for my ignorance.
  • The_Gamesalad_GuruThe_Gamesalad_Guru Member Posts: 9,922
    Look in the rules that changes the image to standing left or right. Sounds like you have a Boolean loop. This is where the Boolean keeps flipping back and forth. This usually happens when you change it back of the otherwise section.
  • chelseywood10chelseywood10 Member Posts: 2
    Look in the rules that changes the image to standing left or right. Sounds like you have a Boolean loop. This is where the Boolean keeps flipping back and forth. This usually happens when you change it back of the otherwise section.
    I had a friend look at it and he said that my character is trying to look both left and right simultaneously, so I think he fixed it. Waiting to see it in action now.
Sign In or Register to comment.