76 reputation
7
bio website
location
age
visits member for 2 years, 1 month
seen Oct 28 '12 at 7:30

Oct
28
comment Cocos2D: Change animation based on joystick direction
Hey, I had to put my cocos2d project on hold, because I programmed an app for a client. However I still try to answer your question, even though I am a bit rusty at that point: What I am doing here is to check, when the joystick is for example pointed upward, if the figure is looking/walking upward. If not, I change it to the kStateWalkingFront. I read the Ray Wenderlich book, where it is explained pretty good. If you use what I have written above, you need to define the kStates somewhere and also put the animation or the link to the animation after the definition. Works fine then :)
Jul
1
accepted Using two joysticks in Cocos2D
Jun
27
awarded  Commentator
Jun
26
awarded  Teacher
Jun
26
answered Using two joysticks in Cocos2D
Jun
25
awarded  Student
Jun
25
comment Using two joysticks in Cocos2D
Problem is the same with zJoystick, even more to be honest. Ill stay with SneakyJoystick. There must be a way to get it to work with it.
Jun
25
comment Using two joysticks in Cocos2D
As of now it doesn't work. But I will try a few things and then get back to you.
Jun
24
comment Using two joysticks in Cocos2D
Thanks. I will look into it and post if it worked, tomorrow. :)
Jun
24
comment Using two joysticks in Cocos2D
Thanks for your contribution, I added the code in question.
Jun
24
revised Using two joysticks in Cocos2D
Edited and added code as per request
Jun
24
awarded  Supporter
Jun
24
awarded  Promoter
Jun
22
asked Using two joysticks in Cocos2D
Jun
18
awarded  Scholar
Jun
18
accepted Cocos2D: Change animation based on joystick direction
Jun
18
answered Cocos2D: Change animation based on joystick direction
Jun
15
awarded  Editor
Jun
15
revised Cocos2D: Change animation based on joystick direction
I changed it. Now it is looking in the right direction when pressing, BUT still doesn't play animations.
Jun
14
comment Cocos2D: Change animation based on joystick direction
And now I get it: Yes I tried with flipX, which didn't work as intended. It flips the y sprite/animation, but not the x sprite. It doesn't even display that one.