here a example, i made in one hour.
the analog input is a little bit special because there i not want a repeat.
and agk not support string as reference, so i used a string in a udt^^
//Combo Input
//agk v2.0.14b
//MR 28.06.2015
global joystick
joystick=1
myCombo as string[64]
myCombo[0] = "Up,Down,Up,"
myCombo[1] = "A,A,A,"
myCombo[2] = "A,B,X,Y,"
myCombo[3] = "B,B,"
myCombo[4] = "X,X,X,"
myCombo[5] = "Y,A,B,"
myCombo[6] = "A,A,B,"
timeout=timer()
local sequence as string
type byRef
value as string
endtype
local UpLast as byRef
local DownLast as byRef
UpLast.value=""
DownLast.value=""
do
print(sequence)
l1=len(sequence)
sequence = sequence + InputA() + InputB() + InputX() + InputY() + InputUp(UpLast) + InputDown(DownLast)
l2=len(sequence)
if l2>l1 //before after check
//it grow up
timeout=timer()
endif
if timer()-timeout>0.75
//grow up timeout, clear sequence
timeout=timer()
//.. maybe here check current value before clear ...
sequence=""
endif
index=-1
for c=0 to 6 //max. combos
if sequence=myCombo[c]
index=c //found sequence
sequence="" //clear sequence
exit
endif
next
if index=>0
lastcombo$=myCombo[index]
endif
print("Last Combo: " + lastcombo$)
if GetPointerPressed() then exit
sync()
loop
end
function InputA()
ret$=""
if GetRawKeyPressed(65)=1 then ret$="A,"
if GetRawJoystickButtonPressed(joystick,1) then ret$="A,"
endfunction ret$
function InputB()
ret$=""
if GetRawKeyPressed(66) then ret$="B,"
if GetRawJoystickButtonPressed(joystick,2) then ret$="B,"
endfunction ret$
function InputX()
ret$=""
if GetRawKeyPressed(88) then ret$="X,"
if GetRawJoystickButtonPressed(joystick,3) then ret$="X,"
endfunction ret$
function InputY()
ret$=""
if GetRawKeyPressed(89) then ret$="Y,"
if GetRawJoystickButtonPressed(joystick,4) then ret$="Y,"
endfunction ret$
function InputUp(Last ref as byRef)
ret$=""
if GetRawKeyPressed(38) then ret$="Up,"
if Last.value <> "Up," and GetRawJoystickY(joystick) < -0.25
ret$="Up,"
Last.value=ret$
endif
if GetRawJoystickY(joystick) > -0.25 then Last.value=""
endfunction ret$
function InputDown(Last ref as byRef)
ret$=""
if GetRawKeyPressed(40) then ret$="Down,"
if Last.value <> "Down," and GetRawJoystickY(joystick) > 0.25
ret$="Down,"
Last.value=ret$
endif
if GetRawJoystickY(joystick) < 0.25 then Last.value=""
endfunction ret$
AGK 108 (B)19 + AppGameKit (Steam) V2 Beta .. : Windows 8.1 Pro 64 Bit : AMD Radeon R7 265 : Mac mini OS X 10.10 (Yosemite)