[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] my rpg game (so far)



On Oct 31, 2008, at 1:21 PM, Michael Fiano wrote:

On Fri, 31 Oct 2008 06:13:15 -0400
Michael Fiano <michael.fiano@xxxxxxxxx> wrote:

Right now if you are holding a directional key to move, and you press
a different directional key at the same time, the player will stop,
instead of changing directions. If anyone could give me some pointers
on how to do this I'd be very happy, because I want it to be
gamepad-friendly too.

Correction: The player doesn't stop when a 2nd simultaneous direction
is pressed. It does stop moving the player under the following
conditions though, and I would like to somehow prevent it:

If you hold down any cursor key then change directions by holding
down another cursor key and then lift your finger off the second to
resume the direction of the first, the avatar will actually stop
instead. I want to resume moving in the first pressed (and
still pressed) direction instead of stopping abruptly. I have tried the
sugestions here to no avail. Are there any games with this type of
movement functionality, or any sample code anywhere?

I think Paul's suggestion was correct, I implemented a similar system for scrolling a map and it works great with multiple combinations of key ups and downs (it's a pyglet app though, so it probably doesn't help you much).

If you have a version that manages x and y speeds by keyup/keydown that doesn't work, maybe you should post it here for folks to look over?

-Casey