Ok, thanks a bunk Ultimate_H
Sorry Heyufool1, your one was just a bit too complicated for my inexperienced mind! PErhaps one day... Thanks anyway.
Now, next question -
I want to crack character movement, and I'm unlikely to do it on my own...
This is what I've got so far -
if(dbShiftKey())dbMoveObject(2,-2.0f);
dbLoopObject( 2, 235, 259 );
dbSetObjectSpeed( 2, 20 );
if(dbControlKey())dbMoveObject(2,1.0f);
if(dbLeftKey())dbTurnObjectLeft(2,3);
if(dbRightKey())dbTurnObjectRight(2,3);
What happens at the moment is that the animation loop keeps going on. What I need to happen is:
- Use WASD as direction keys. (For scancodes, W is 18, A is 31, S is 32 and D is 33)
- The animation only plays when the key is held down.
- When the character moves backward, the animation is reversed. I know that is done by making the speed negative, but I cant seem to influence the change from positive to negative through backward movement.
- Unless this is being too ambitious, when the player presses either left or right, is it possible for the character to turn just 90 degrees in that direction?
Cheers all!