HELP REQ: a three-jump block? Mine-Bert

Hello friends. I was messing around with a new concept MINE-BERT (A cross between Minecraft and Q*Bert) and ran into a problem that I’m sure someone has a work around for.

Here is what I’m trying to do:
When Steve jumps on a block I want it to turn from Grass to Dirt.
When jumped on again I want it to change from Dirt to Stone
on a third jump the block turns from Stone to Sand
and on a final jump the Sand falls away (and you go with it).

Behaviors are in the “grass” block.

I’ve done “hit point damage with damage animation” in other games and thought the solution to this would be similar, but because Steve is still on the block before he jumps away and jumps back, it runs through the whole routine (except for falling away after sand… which I haven’t programmed yet). I’ve tried triggering specific frames in a single animation (GO TO FRAME 1-Dirt. 2-Stone. 3-Sand) and I’ve tried jumping between separate animations (PLAY ANIMATION: Dirt. PLAY ANIMATION: Stone… etc)

I feel like I need it to ALWAYS check if Steve has jumped on the block, but I cant figure out how to stop checking for Steve until he leaves and comes back. All my switches cascade to the end of the sequence and I can’t figure out how to configure the switches to break the chain up.

I was pretty pleased with how the move mechanic turned out though. Let me know what you think so far and if you think you have a solution to the three-jump block.

MINE-BERT - https://flowlab.io/game/play/1397176

Controls: 7, 9, 1, 3 for diagonal jumping.

@todorrobot,
I got it to work when stepping on them in order while using an always with an easier set up.
I also just used the 1 raycast as the input.

2020.04.14-16.55

Excellent! Thanks @“JR 01”

I knew the triple raycast wasnt practical but I was starting to try some wacky solutions. I feel like I was pretty close in some of my first attempts, but I dont think I had anything quite as simple and elegant as your solution (traits which the abundance or my programming lacks). Thanks again! much appreciated!

Actually @todorrobot, use this.
Using the mailbox keeps it from double scanning (from the jump animation) when the raycast hits Steve.
Also the Switch needs to be on:

2020.04.14-17.06

That worked perfectly. Thanks @“JR 01”

Now to toss this game aside and work on the minimalist game jam. LOLOL!