Wintermute Engine Forum
Wintermute Engine => Technical forum => Topic started by: SBOVIS on September 20, 2006, 11:19:40 AM
-
Hi all,
I have a 2D actor sprite that walks in the normal 8 directions.
Is it possible for the actor to turn correctly in relation to where the player clicked on the screen?
For example: - Actor is facing downwards, player clicks to the right and the actor turns to the right using a smooth turning animation.
Also if Actor facing downwards, player clicks UP the actor smoothly turns on the spot upwards.
Is this just a case of : -
of just adding TURN_UP,TURN_DOWN,TURN_UPRIGHT etc etc??
or am I barking up the wrong tree??
-
Well the actor should do just that, providing the TURN_LEFT and TURN_RIGHT animations are defined. Perhaps the names are a little misleading, more suitable names would be "turn clockwise" and "turn counter clockwise".
-
Ahhhhhh I see, so the animations below TURN_LEFT are the sprite positions for the actor at those points from clockwise motion.
TURN_RIGHT are sprite positions for the actor from anti-clockwise.
OK got it, at the moment I just have one frame in the sprite files and the main actor turns a little sharp and quickly, If I add more frames this will smooth this out I take it.