user1351956
user1351956

Reputation: 31

Cocos 2D - Sprite Facing direction

I'm curious on how to determine the facing direction of a sprite? I have a button action that moves the sprite 9 pixels on the x axis which works fine. However when the sprite is turned to the -x axis it still moves toward the positive x axis.

Upvotes: 0

Views: 418

Answers (1)

Nikhil Aneja
Nikhil Aneja

Reputation: 1259

Rotation and movement are two different things... Rotation doesn't determine direction....

If you move it towards x-axis.. It will not face x-axis.. It will just move... If you rotate it by an angle, It will still move in same direction unless you change its movement...

Rotation just tells facing of sprite... Hope this helps.. :)

Upvotes: 1

Related Questions