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

2014/5/4

Facing of actor in different direction

parthshah333 parthshah333

2014/5/4

#
I have a scenario where I have an actor as an Image of a person. First I move that actor to right direction. Now after moving to a certain location. I want to move that actor to downwards direction without rotating the image of that Person. The image should remain same. But, the actor should move in downward direction. Can anyone suggest some idea?
danpost danpost

2014/5/5

#
Use an instance int field to track the direction (or the "rotation" that it would take on to move in the direction wanted). Then to move: set the rotation of the actor to the value of the field, move the actor and then reset the rotation of the actor back to zero.
You need to login to post a reply.