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

2016/10/8

How do I make and object point in a specific direction?

minionlover minionlover

2016/10/8

#
An arrow should be told to rotate to face the same direction that a Stylus just moved in. For example, if the Stylus was just moved to the right then the arrow should face east, if it was moved up then the arrow should face north.
danpost danpost

2016/10/9

#
minionlover wrote...
An arrow should be told to rotate to face the same direction that a Stylus just moved in. For example, if the Stylus was just moved to the right then the arrow should face east, if it was moved up then the arrow should face north.
Use the 'setRotation' method of the Actor class. If the arrow and the Stylus are two different objects, then maybe the Stylus should keep a reference to the arrow and tell it, the arrow, to rotate when it, the Stylus, moves.
You need to login to post a reply.