Help with important project

i cant make a trap when i step on the trap i die but if you are fast enhough then you can survive but if you fall in to the hole then you die that was what i was going for
help i cant do it alone thanks

Love the look and sound of your game, @SoftTalker !

I see some interesting logic in your on overlap routines, and I understand why it’s there. Whenever I’m trying to figure out why my program isn’t working the way I want it to, I try to simplify the problem. Sometimes, I work within the project to simplify things. Other times, I create another project to focus on the problem.

In this post, I’ll walk you through my process of changing your program so that it behaves the way you’re expecting.

So, I started by creating a new project with just your on overlap routine for a Player first walking on top of a Pit. Take a look at this:

It looks like you’re using counter to make sure that the on overlap routine only runs once on a particular pit. If you run my Pit Test I project above, you can place the duck as long as you want on a pit cover, and the counter never goes above 1. (The counter variable appears as the player’s score.) For a particular collision (i.e., a collision between a particular pair of sprites), the event handler should never run multiple times simultaneously.

It works with animations and multiple pits, too. Take a look at this:

Notice that, if you’re quick enough, you can get counter to go above 1. Something to keep in mind. I also can see another problem that we’ll likely encounter a little later.

Now that we have that out of the way, we should be able to simplify the code for that event handler. Take a look at this:

You have two pauses in your original code, and I’ve left them in my code, too. Your animation does not count as a pause – You’ll notice that the sprite says, “Uh oh!” as soon as the animation starts. If we look at our code, our sprite also should say, “Falling!” when it’s over a pit. That does not trigger … and it’s because your animation resolves to a fully transparent sprite. Transparent sprites cannot trigger collisions.

So, let’s make one more change.

I’ve filled in the last frame of your animation to all black, which is how it appears in your game. Play around with the pauses and set them to different values to see how they work. The first pause gives the player a little time to get away before actually falling. You’ll also notice that the second pause doesn’t do anything.

Now our program seems to work the way that we want. Let’s apply those ideas back to your original code.

I think this version is working they way you’re expecting.

If you have any questions, then feel free to ask. Good luck!

1 Like

You’re very good at this! Thanks a lot. I appreciate your help. :grin:
Thanks again!

1 Like

o now when i try to load a new level it’s still there
i’ll try my best to fix it

The destroy all sprites of kind block might be helpful to you.

1 Like

I love the music and need for a super Mario game but how did you get that special block in the sounds menu

Ring Tone Transfer Language… is a popular format for tunes. With this library, you can play existing RTTL tunes in Arcade.



Convert RTTL tunes to MakeCode melodies. Contribute to pelikhan/pxt-rtttl development by creating an account on GitHub.

here has all the noted and help and things i did so enjoy
Btw vote should i continue or…

  • Continue plz continue
  • Stop Just stop
  • Idk“¯_(ツ)_/¯ “

0 voters

1 Like

Cool game! I’m glad you like my blur extension! Always remember though, you want to blur at the right time, so here’s a version where it transitions in after the stage has been rendered but before the HUD loads!

btw this is the cade lol

Thanks a lot