This is a rather specific problem that I'm not too sure how to handle. I'm recreating Super Mario 1-1.
I have a Level scene which is the level itself. I have a Brick scene which is the scene I use for the breakable blocks that Mario can hit with his head to destroy. The Level scene has multiple of the Brick scenes. I have a Player scene for Mario, and one Main scene to put everything together.
Right now I'm trying to work out how to make the breakable Bricks and Mario interact properly. At the moment I have a simple program in the Brick scene to have it so the Brick disappears when Mario enters the Area2D at the bottom of the Brick block.
The first thing I need is a way to make it so Mario can only break one block per jump. Mario's jump can hit multiple blocks in one hit, but I only want one block to break each jump, ideally with a way to bring Mario's velocity down one he hits a block.
The second thing I need is a way to tell the Blocks to only break when Mario is in Big or Fire form but not in Small form. I have a player_state variable in Player scene that indicates which form Mario is currently in. --- I know how I would solve this if it's just one Block in the level. I could just use signals to send player_state to the Block, but since I have a huge number of Blocks I'm not sure how to handle it.