Probably a simple solution, but I have a question

DrPatrickBatemanDrPatrickBateman Member Posts: 5
edited October 2012 in Working with GS (Mac)
I'm creating a game for one of my game design classes using game salad, and I'm hung up on one thing. I have a character who is animated for left and right motion, with my actor sprite being the right facing character, so when I run the left and right motion, it automatically switches to the right facing sprite. I tried using the "Change Image" behavior, but it didn't work, at least not the way I tried it, and by checking the box in the animate behavior that lets you choose whether the animation reverts back to the main sprite or stops where your key press stops made the animation look silly.

Sorry if this has been asked, but I didn't know how to phrase this question in a search.

Comments

  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    so, what are you trying to do?

    "I have a character who is animated for left and right motion, with my actor sprite being the right facing character, so when I run the left and right motion, it automatically switches to the right facing sprite. "

    I'm reading this as it currently works when you move left and right your graphics represent the direction. Or is this what you are trying to accomplish?
  • DrPatrickBatemanDrPatrickBateman Member Posts: 5
    The game I'm trying to create is a 2d sidescrolling shooter. I'm sorry I didn't phrase it well, let me try and clarify.

    In my actor, I created a rule that says "when d or right key is touched" animation and motion are activated to create the look of a man running. The right motion and animation are fine for all intents and purposes because the sprite I used to represent the actor, the sprite that was created to stand still, is facing right.

    The animation for moving left is what is causing the issues. I have a sprite where the standing animation (that should take place AFTER the completion of the motion and animation of moving left) but I cannot get it to work.

    So essentially, I move right, then my character stops and faces right. But if I move left, my character stops and flips immediately facing right, when I would prefer to keep him facing left.

    Does that clarify what I mean a bit better?
  • gamesfuagamesfua Member Posts: 723
    Call me bonker town, but wouldn't it be great if GS had some better display text functionality. Trying to see if your text works via preview is a pain the ol' butt-a-roo if you ask me. Sorry for not providing any help here hehe.
  • SingleSparqSingleSparq Member Posts: 1,339
    edited October 2012
    Yes-so for my actor I have a timer set to check every 0 seconds and if actor is facing right (that is my right boolean attribute is ON as I had went that direction) I have my graphics flip set to 0 (under graphics attributes for the actor) if I was going left (left attribute is ON) graphics switch =1. Only one right facing graphic or animation is needed then.

    There may be other ways but this worked for me.
  • DrPatrickBatemanDrPatrickBateman Member Posts: 5
    edited October 2012
    Yes-so for my actor I have a timer set to check every 0 seconds and if actor is facing right (that is my right boolean attribute is ON as I had went that direction) I have my graphics flip set to 0 (under graphics attributes for the actor) if I was going left (left attribute is ON) graphics switch =1. Only one right facing graphic or animation is needed then.

    There may be other ways but this worked for me.
    I've had some issues trying that. I set two separate timers, one that runs every 0 seconds and checks if self.rightfacing is true, and another one that checks to see if self.leftfacing is true. If self.leftfacing is true, I have a change attribute function within the timer set to flip horizontally, and within the left motion group, I have 2 change attribute functions, one to change rightfacing to 0 and another to change leftfacing to 1, yet it still doesn't work. Am I missing something really obvious?


    EDIT: Nevermind, I got it. I was editing the actor, but I had a prototype on the scene, thats why none of the changes I made had any effect.
Sign In or Register to comment.