Button Sequences?

Is there a way to trigger a script after a button sequence instead of only a single press?

For example, cheat codes?

My reason for asking is I want to trigger a script on a button double tap:

down double tap = action

edit:
On that same note, how about when two buttons are pressed simultaneously? The input manager seems to support this, but I cannot get it working.
It just activates the action if either of the buttons is pressed.
 

dale_coop

Moderator
Staff member
I don't (yet) how to check a sequence of buttons...
But for multi buttons: For exemple A+Up to execute a script
Assign the script to "Press" "A"... and in the script, at the beginning, you check if the other button (Down) is pressed:
Code:
    ;LDA gamepad
         ;+---------- is it moving horizontal? 0 = no, 1 = yes
		 ; + left or right? 0= left, 1= right
		 ;  +-------- is it moving vertical? 0 = no, 1 = yes
		 ;   + up or down? 0= up, 1= down	
    CMP #%00010000 ;; check if UP is pressed
    BNE endExecutingScript ;; not pressed then exit

    ;; else (means the UP key was pressed):
    ;;
    ;; DO everything you want in your script
    ;;

endExecutingScript:
    RTS


There is a lot of possibilities to check:
CMP #%00010000 ;; check if Up is pressed
CMP #%00100000 ;;check if Down is pressed
CMP #%01000000 ;;check if Left is pressed
CMP #%10000000 ;;check if Right is pressed
CMP #%00000010 ;;check if B is pressed
etc...
 
Top Bottom