Page 1 of 1

Moving Problem and changing animation before moving 4 ways

PostPosted: Wed Sep 13, 2006 12:33 am
by ericdg
Question 1

I am making a pocket pc game. I thought I would not have all the slide - moonwalk problems that you would with a keyboard since I am using a directional pad.

I don't have the slide problem if I were only wanting to go left or right like in a platform game, but I want to do a top down game with a vehicle that moves up, down, left, right.

The problem lies with the 8 way directional pad of atleast my pocket pc and I'm sure other pocket pc's have an 8 way pad too.

When my pad hits an angle, like up and right it moves in that direction and I can set up an animation for that direction. When I move the pad from up right to right, it still shows the angle animation. Or when I move from up right to up I have the same problem.


I would actually be fine with only 4 directions. So I tried to make up right combo cancel out the x and y movements. This does stop the vehicle from moving at the angle, but it changes the animation to right, and it stays at right if I move the pad back in the up position causing the vehicle to move upwards with a right animation.

I tried makslane's avoiding platform slide code and it works for 4 directions, but when I hit the angles it still messes up the animation.

I am going to try Novice's code and I think that will work fine, I am just concerned it will be a performance hit on the pocket pc platform.

I can't believe this is such a big problem, and that there is not an easier way to do it.


Which brings me to question 2.

If Novice's code does work and is not a big hit on performance, or I find another way of doing it, does anyone know how I could achieve this desired effect.

If possible I would like the vehicle to show an animation of the vehicle turning to the direction I press before it actually moves in that direction. I think this can be achieved using wait for animation, but I don't know exactly how.

What I mean is now, I press right and it shows the vehicle pointing right, when I press left it instantly changes the vehicle to the left position, not very realistic.

If I could have the vehicle show an animation of it turning to right from left and all the other directions it would look much better.

Any ideas? Thanks guys.

Re: Moving Problem and changing animation before moving 4 wa

PostPosted: Wed Sep 13, 2006 2:44 am
by makslane
I think you have the combined moves for two pressed keys, not a real 8 direction pad.

So, if you have an animation for the up and right keys, try handle the 'Key Up' event for the up key to avoid the wrong animation.


ericdg wrote:If Novice's code does work and is not a big hit on performance, or I find another way of doing it, does anyone know how I could achieve this desired effect.


Where's the post?

PostPosted: Wed Sep 13, 2006 8:14 pm
by ericdg
http://game-editor.com/forum/viewtopic. ... ing+engine


My question is about getting the vehicle to turn before it goes in that direction, I think I can get novices code to work for the sliding problem.