Using match function to check for sequential inputs?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By ZachMoldof

Hi, I’m new to coding and Godot. I’ve been reading some python tutorials to try and find a way to solve a problem in the game I’m building. It’s a 2D isometric skateboard game. I’ve created all my art, and begun building the game.

I’ve got my charcter moving through a demo level effectively, and I can read single inputs to trigger tricks. But I need to find a way to be able to combine tricks, and create more complicated inputs that rely on multiple button presses.

My controls are set up like an 8 bit nes: up, down, left, right, B, A.
All tricks have a start and stop input. They either start with button a and end with button b, or start with button b, and end with button a. First button press is the “pop”, and second button press is the “land”. Directional inputs between the button presses will change what tricks happen.

I’m thinking that I can define a function that will run a match on the “pop” and close on the “land”. The match will check against a dictionary, and the dictionary is a list of inputs that trigger animations when they come back true.

I’m gonna give it a shot on my own and see what I can come up with. But I just wanted to check here first to see if anyone has some good insight for me. Thanks.

:bust_in_silhouette: Reply From: flurick

Nah sounds good man.