Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers DBPro Corner / making character go diagonal (for an rpg type game)

Author
Message
AdamG
22
Years of Service
User Offline
Joined: 12th Sep 2002
Location: United Kingdom
Posted: 29th Nov 2009 18:11 Edited at: 29th Nov 2009 19:33
Hi,

I've managed to get character to turn in 4 directions, but am unsure how i get the diagonal directions to work, they just slide along instead of playing animation.

Any help would be greatly appreciated

The code is below

Rudolpho
18
Years of Service
User Offline
Joined: 28th Dec 2005
Location: Sweden
Posted: 30th Nov 2009 10:24
Check that only the one direction key is pressed to turn in one direction.
If more than one key is pressed, either do nothing, or, if the keys are next to each other (ie. right and up) then move diagonally upwards to the right by increasing both the x# and y# positions by the same amount.

Login to post a reply

Server time is: 2024-11-23 23:05:17
Your offset time is: 2024-11-23 23:05:17