OliverW

Rotate Sprite 90 degrees without changing angle for physics.arcade

Recommended Posts

Hi,

my sprite is pointing to the top. But the angle = 0 means the it points to the right. So if i start moving, e.g. with

velocityFromAngle

the movement direction is default to the right, while the sprite is facing to the top. If i try to turn the sprit 90 degrees to the right, the angle for the movement also changes (the movement direction is then down). so the movement direction and the pointing direction of my sprite are never the same.

one way would be to change the sprite image. but i want to be flexible to move it in all 4 directions (90 degrees steps), depending on its random start postion. this has to be possible somehow. please help me

in other words

now: sprite is ^ and movement direction is >

if i change the angle then sprite is > but movement direction is v

what i want is the this:

Sprite > and movement direction >

or

Sprite ^ and movement direction ^

or

Sprite < and movement direction <

or

Sprite v and movement direction v

 

best regards

Oliver

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.