Saturday, 7 September 2013

Flip character horizontally (top lef registration point)

Flip character horizontally (top lef registration point)

I have created Mario character, it is playing different animation like
standing, walking, jumping...Everything is ok but flip horizontally. In my
key_down function I set if rightKey is pressed player.scaleX = 1, else
leftKey is pressed player.scaleX = -1;
It works, my english is not so good so here is the link to understand
better :
http://www.fastswf.com/vsi-Wps
The only problem is that even if you touch only one time left or right
key, it will flip player but also it will move the player about 30px (lets
say).
I used this before and it works ok if player has center registration
point, but now I have top-left registration point and dont know how to fix
this?
Can anyone explain?

No comments:

Post a Comment