This site requires JavaScript, please enable it in your browser!
Greenfoot back
Oxy
Oxy wrote ...

2013/1/6

How do I get the direction an Actor is moving?

Oxy Oxy

2013/1/6

#
When my actor ( which is constintly in motion, via move(4) ) goes to the left side of the world is upside down, i want to make it so that when my Actor is moving in the degrees 181 to 359 to face left, using an image i have so setImage(leftImage) and in vice versa so when i turn left to right the image reverses to what it was before. how do i test for direction so i can change it up?
vonmeth vonmeth

2013/1/6

#
You can get the rotation degrees with the getRotation method.
danpost danpost

2013/1/6

#
@vonmeth, I believe that is what Oxy is using; however, half the time the image is upside-down. @Oxy, when the rotation is between those values that the image appears to be upside-down, flip the image with 'mirrorVertically'.
Oxy Oxy

2013/1/6

#
yup, that was what the problem was thanks danPost
You need to login to post a reply.