How do I implement an input buffer?

Just started using Construct 2? Post your questions here

Post » Fri Feb 13, 2015 1:18 pm

Hello everyone,

Is there any tutorial/information you'd recommend to implement an input buffer in Construct 2, the kind of which could be used to make fighting games?

Thanks in advance,

Marcelo
B
9
S
3
Posts: 40
Reputation: 780

Post » Fri Mar 06, 2015 9:21 pm

What do mean by an input buffer? When you press a key, construct will handle the key press on the next tick, it process the input for you.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Fri Mar 06, 2015 9:26 pm

An input buffer like the ones in fighting games that allows the creation of special movements
B
9
S
3
Posts: 40
Reputation: 780

Post » Sun Mar 08, 2015 9:15 pm

You could create an array with a length that of the longest combo, then after each button press, check the last x keys in the array.
Nothing goes unanswered!
B
22
S
5
G
1
Posts: 430
Reputation: 3,388

Post » Tue Mar 10, 2015 11:18 am

That's kind of the idea indeed.
Each tick check if you have currently expected input pressed. Save the key code or the "meaning" you intend the input to have in an array.

Then run this array through a function/group that is meant to "translate" this array to moves in your game.
Be sure to clear the oldest entry(ies) of the array on a regular basis. (You may need to save the timestamp for the input when setting the input value into the array to make sure you keep the duration consistent).
New to Construct ? Where to start

Image Image

Image Image

Please attach a capx to any help request or bug report !
Moderator
B
263
S
93
G
56
Posts: 7,177
Reputation: 67,648


Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 0 guests