# Help with important project

**URL:** <https://forum.makecode.com/t/help-with-important-project/13645>\
**Category:** Help\
**Created:** [May 18, 2022, 5:04pm UTC](https://forum.makecode.com/t/help-with-important-project/13645 "2022-05-18T17:04:01Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [May 18, 2022, 5:04pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/1 "2022-05-18T17:04:01Z")

</div>

> **[PROJECT Duckie](https://arcade.makecode.com/64091-80867-57630-58287)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [May 18, 2022, 9:21pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/2 "2022-05-18T21:21:33Z")

</div>

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:

> **[Pit Test I](https://arcade.makecode.com/26684-65801-41398-27528)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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:

> **[Pit Test II](https://arcade.makecode.com/86811-46272-17793-66566)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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:

> **[Pit Test III](https://arcade.makecode.com/40166-87712-71829-30588)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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.

> **[Pit Test IV](https://arcade.makecode.com/70287-37065-42054-52338)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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 `pause`s 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.

> **[PROJECT Duckie](https://arcade.makecode.com/12013-37827-50580-89682)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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

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

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [May 19, 2022, 6:36pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/3 "2022-05-19T18:36:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [May 23, 2022, 4:50pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/4 "2022-05-23T16:50:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [May 24, 2022, 5:16pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/5 "2022-05-24T17:16:18Z")

</div>

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a449cb1b244ec62e6a54969d723002031fcad3c3.png)

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [May 31, 2022, 4:35pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/6 "2022-05-31T16:35:57Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [June 1, 2022, 5:19pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/7 "2022-06-01T17:19:45Z")

</div>

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

- RTTL [https://en.wikipedia.org/wiki/Ring\_Tone\_Transfer\_Language](https://en.wikipedia.org/wiki/Ring_Tone_Transfer_Language)

![](https://github.githubassets.com/favicons/favicon.svg)[GitHub](https://github.com/pelikhan/pxt-rtttl)

![](https://avatars2.githubusercontent.com/u/4175913?s=400&v=4)

### [pelikhan/pxt-rtttl](https://github.com/pelikhan/pxt-rtttl)

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

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [June 1, 2022, 5:25pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/8 "2022-06-01T17:25:35Z")

</div>

> **[PROJECT Duckie](https://arcade.makecode.com/27879-91750-90673-90014)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

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

_Poll ([view on site](https://forum.makecode.com/t/help-with-important-project/13645/8))_

---

<div class="post-metadata">

**Author:** ![Kiwiphoenix364](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/kiwiphoenix364/32/14368_2.png) [@Kiwiphoenix364](https://forum.makecode.com/u/Kiwiphoenix364)\
**Post date:** [June 1, 2022, 10:10pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/9 "2022-06-01T22:10:41Z")

</div>

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!

> **[PROJECT Duckie](https://arcade.makecode.com/25087-30154-04450-01771)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [June 2, 2022, 4:10pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/10 "2022-06-02T16:10:21Z")

</div>

btw this is the cade lol

 ![arcade-screenshot (2)](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/3/3c09295c7754dd3af78f07460e8f8830b436d79e.png)

---

<div class="post-metadata">

**Author:** ![SoftTalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/softtalker/32/10776_2.png) [@SoftTalker](https://forum.makecode.com/u/SoftTalker)\
**Post date:** [June 2, 2022, 4:10pm UTC](https://forum.makecode.com/t/help-with-important-project/13645/11 "2022-06-02T16:10:23Z")

</div>

Thanks a lot
