Keys under pressure (fixed)

Started by ShiverMeSideways, Fri 03/02/2012 06:09:44

Previous topic - Next topic

ShiverMeSideways

Hello,

As you might know, I'm working on a platforming engine and one of the movement options which is VERY important is that of jump control. In order to implement that, I require to check how hard the player is pressing the jump key. How can I do that in AGS? CAN I do that in AGS? I would need three "grades" of jumping.

Thanks a lot for your help! :)

Khris

Is this a joke? Are you talking about keyboard keys?
There hasn't been a single keyboard in the history of computers that measures pressure. It's a binary thing, 0/1, pressed or not.

The only way of implementing this is using a gamepad's trigger as jump key; this is possible with the agsjoy plugin.
However, what's wrong with the traditional method of pressing the key longer to jump higher, used since possibly 1980?

ShiverMeSideways

I'm sorry Khris for seeming overly thick (because I am), but yeah, I was referring to any way of simulating or implementing jump control with a keyboard, thank you for pointing out a method of doing that. I was having trouble visualizing it and the code.

Khris

Well, all you need to do is accelerate the player a bit longer after they left the ground.
Basically, add a constant amount to their y movement each frame for x frames if the jump button is still pressed.


SMF spam blocked by CleanTalk