Page 1 of 1

RPG maker styled movement

PostPosted: Thu Dec 06, 2012 3:21 am
by Hblade
I've made plenty of these before but I thought up of a different way for moving. I know there are better ways to do this but its been ages since I programmed haha. Thought I'd release this.

Moving on a "grid" style, you can't change directions in the middle of moving and you can easilly change the keys / speed / distance of the grid.

Files available in rar or zip

Re: RPG maker styled movement

PostPosted: Thu Dec 06, 2012 7:05 pm
by knucklecrunchgames
like it :mrgreen:

Re: RPG maker styled movement

PostPosted: Fri Dec 07, 2012 2:25 am
by Hblade
ty xD

Re: RPG maker styled movement

PostPosted: Sat Dec 08, 2012 2:06 am
by happyjustbecause
Pretty cool, I did get one bug while playing. The "player" got stuck in a walking animation and stopped moving. I was able to get out of it easily, but just wanted to let you know. But cool grid movement.

Re: RPG maker styled movement

PostPosted: Wed Dec 12, 2012 5:23 pm
by jimmynewguy
Nice work, the only thing that bothers me is that you have 4 key down events when you can use 1!

KeyDown -> w a s d -> at least one is pressed
Code: Select all
int key = getLastKey();
switch(key) {
case KEY_w:
break;
case KEY_a:
break;
}
Just because it's easier to keep track of everything :)

Re: RPG maker styled movement

PostPosted: Wed Dec 12, 2012 7:49 pm
by skydereign
jimmynewguy wrote:Nice work, the only thing that bothers me is that you have 4 key down events when you can use 1!

KeyDown -> w a s d -> at least one is pressed
Code: Select all
int key = getLastKey();
switch(key) {
case KEY_w:
break;
case KEY_a:
break;
}
Just because it's easier to keep track of everything :)

Actually, that isn't completely true for his code. That key down event must not enable repeat, which will probably change the result. Namely, getLastKey isn't guaranteed to get the key press, if it is set to repeat (as another key could have been pressed after). Though, in that case he can just put the code into the draw actor event.

Re: RPG maker styled movement

PostPosted: Wed Dec 12, 2012 8:43 pm
by jimmynewguy
Oops, I guess I didn't notice he used repeat.

Re: RPG maker styled movement

PostPosted: Fri Dec 14, 2012 3:11 am
by Hblade
Thanks for the feedback guys