The victims of my game are making fun of the bad guy
LordTarantor
Member, PRO Posts: 890
Hi everybody:
I think this is a hard one because I already created 3 forum questions and nobody has answers it.
I am using a joystick to move the bad guy in my game but the problem is that when it changes direction it turns up side down while he is traveling that direction, he looks funny instead of horrifying and I know that the victims makes fun of him while he is running with his head. I almost hear them laugh...
What I need the frustrated bad guy to do is that while he is traveling directly or diagonal to the right the image face to that direction and when he does it to the left it change image to that direction.
I know how to do this if I were using the left or right buttons but with the joystick, I have no clue.
I think this is a hard one because I already created 3 forum questions and nobody has answers it.
I am using a joystick to move the bad guy in my game but the problem is that when it changes direction it turns up side down while he is traveling that direction, he looks funny instead of horrifying and I know that the victims makes fun of him while he is running with his head. I almost hear them laugh...
What I need the frustrated bad guy to do is that while he is traveling directly or diagonal to the right the image face to that direction and when he does it to the left it change image to that direction.
I know how to do this if I were using the left or right buttons but with the joystick, I have no clue.
Comments
Then, you can use that angle to do a check. If angle is greater than 90 and less than 270, change attribute left or right to false (if false is left and right is true), otherwise change it to right.
This, only if joystick is touched.
Then, you can have rules like "if joystick is touched"
Rule left or right is false, animate left walk, otherwise, animate right walk
"if joystick is not touched"
Rule left or right is false, animate left stop, otherwise, animate right stop.
It should work
I've amended Codemonkey's joystick control template so that my character revolves to the particular angle that the joystick control is that; I'd gladly work out again what I did to let you know, if you like. although I'm thinking that your player isn't top-down like mine. So although the player can roam freely, only face left or right when the joystick is in the left or right hemisphere?
If that's what you mean, you need to change the image (or images) based on the vector angle, where 0 to 180 is right, 181 to 359 is left. But how you do that, of the top of my head, I'm not certain.
But hopefully that'll give you a starting point to experiment. Hope I've been some help.
""You are in a maze of twisty passages, all alike." - Zork temp domain http://spidergriffin.wix.com/alphaghostapps
That makes sense the 0 to 180 and 181 to 359 but I just dont know how or where to go with this I am going to star changing stuff to see if I hit it but I you come up with something or any other Idea please help me. This is the only thing I need to finish my game.
Thanks Gyro.