Key up events with multiple keys

Questions, comments and discussion about the Game Editor development.

Key up events with multiple keys

Postby bamby1983 » Fri Jan 25, 2013 2:24 am

I have a top-down view for my game and I'm trying to create 2D unit movement. I want to have 8 directions, so the unit would move diagonally when two non-opposing direction keys are pressed. Upon key up, the unit stops moving and remains facing the direction it was moving in.

The issue occurs during the key up event, where GE only allows a single key to be defined for this event. So if my unit is moving towards the top-right, I cannot leave it facing that direction when I stop pressing the keys. The unit ends up picking between the right and the top keys to determine the final position. Is there some way by which I can direct the actor to switch to the top-right animation stop position in such a case?

Also, if my actor is travelling at an angle (up and right together for example) and I release the "up" key so that only the "right" key is pressed, the animation does not change to that for movement towards the right. Instead, the key up animation for the up key gets frozen instead. Is there a way to work around this as well?
bamby1983
 
Posts: 112
Joined: Tue Jul 31, 2012 11:36 pm
Score: 8 Give a positive score

Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron