Handle movement with key press or key down?

Get help using Construct 2

Post » Tue Jan 31, 2012 9:14 pm

I have a design/structure question related to player platform behavior movement. Custom controls is set to true. The main question is related to ON_KEY_PRESS vs ON_KEY_DOWN.

Here is the keyboard code:



Here is the actual movement code itself.



For example, the jump is implemented as ON_KEY_PRESS, but I could have just as easily implemented it as ON_KEY_DOWN.

Which do you think is better? Sometimes it just feels like my character isn't too responsive when jumping, especially when attempting to do lots of little hops.

Keyboard logic is separated from movement logic for purposes of handling multiple players.

Looking at this code, what do you think? Is this a poor way of implementing keyboard controls, player movement and animation?

Thanks!!!
-- cacotigon
B
30
S
6
G
8
Posts: 232
Reputation: 6,119

Post » Wed Feb 01, 2012 3:14 am

Hmm, I just did some more checking, sometimes it seems like with this code when the CPU usage is maxed out and the frame rate drops, the jump release key code sometimes won't detect, so even if I just barely tap the key, the player sprite will jump to its furthest height.
B
30
S
6
G
8
Posts: 232
Reputation: 6,119


Return to How do I....?

Who is online

Users browsing this forum: Colludium and 27 guests