# Sharing my project "Dave Awesome"

**URL:** <https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400>\
**Category:** Show & Tell\
**Created:** [June 12, 2020, 12:09am UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400 "2020-06-12T00:09:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MINTGenie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mintgenie/32/1052_2.png) [@MINTGenie](https://forum.makecode.com/u/MINTGenie)\
**Post date:** [June 12, 2020, 12:09am UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400/1 "2020-06-12T00:09:11Z")

</div>

Here is a take on the 80s game - “Dangerous Dave” [https://makecode.com/\_c3mdmh1uqXMb](https://makecode.com/_PXqECpXwydfh)

- Have finished upto 3rd level (90% - Need to add some Gems and spider’s ability to shoot)

Thanks to a lot of help from Makecode Team @richard, @shakao, @darzu, @jwunderl and @peli .

Do share your feedback

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [June 12, 2020, 1:49am UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400/2 "2020-06-12T01:49:29Z")

</div>

Fun game 🙂 is this the one that you were saying had an issue on the stream?

---

<div class="post-metadata">

**Author:** ![MINTGenie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mintgenie/32/1052_2.png) [@MINTGenie](https://forum.makecode.com/u/MINTGenie)\
**Post date:** [June 12, 2020, 8:05am UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400/3 "2020-06-12T08:05:43Z")

</div>

Yes, (latest published here: [https://makecode.com/\_PXqECpXwydfh](https://makecode.com/_PXqECpXwydfh) problem i have now is:

- on level 3, the seaweed animations start overlapping when you lose a life and reload the level; even though, I am destroying the resources in “destroy level” function.

Some help on this is also appreciated.  
Warm regards  
MINTGenie

---

<div class="post-metadata">

**Author:** ![jwunderl](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jwunderl/32/5308_2.png) [@jwunderl](https://forum.makecode.com/u/jwunderl)\
**Post date:** [June 12, 2020, 8:51pm UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400/4 "2020-06-12T20:51:09Z")

</div>

Ahh, I see; here’s a version that should be fixed:

> **[DaveAwesome](https://arcade.makecode.com/43493-89987-66323-48675)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

In the version you had, you were iterating over all the tiles that had started off with weeds / gems and calling destroy ‘gem’ or destroy ‘weed’; it’s important to note that the variables you were destroying in those loops were only ever referring to the last sprite of that kind that was created. Whenever you create a new variable with `set mySprite to ...`, mySprite will refer to the new thing that you set, not any of the other ones that it referred to previously.

There’s two easy ways to fix it; since you added the tilemaps extension I used the easiest way (the destroy all of kind block), but for reference you could also do this:

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

that gets an array of all the yellow gem sprites, and says to delete those.

---

<div class="post-metadata">

**Author:** ![MINTGenie](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mintgenie/32/1052_2.png) [@MINTGenie](https://forum.makecode.com/u/MINTGenie)\
**Post date:** [June 12, 2020, 9:19pm UTC](https://forum.makecode.com/t/sharing-my-project-dave-awesome/2400/5 "2020-06-12T21:19:51Z")

</div>

Wow!!! I totally missed this block. thanks for the tip. this feels much better now - code is cleaner too
