# While Overlapping - Chopping Trees - Status Bars and HUD

**URL:** <https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788>\
**Category:** Help\
**Created:** [May 3, 2021, 4:23pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788 "2021-05-03T16:23:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [May 3, 2021, 4:23pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/1 "2021-05-03T16:23:49Z")

</div>

Hi,

**I am now trying to:**

1. Make it so when mysprite overlaps with a tree, it shows its status bar, and when the character walks away it disappears.

I’m actually making some progress! However, now I’ve got this blinking issue of the status bars…

What I did was: on game update every 500ms, the game checks whether mysprite is overlapping with any of the trees. If it ISN’T; it makes ALL the status bars for the trees invisible…

When my sprite overlaps a tree, it makes THAT status bar visible…

I’ve tried putting in a variable with an IF statement on the game update 500ms but I haven’t got it quite right.

> **[Tree Chopper V0.5](https://arcade.makecode.com/53728-14770-80888-35371)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

Thoughts?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [May 3, 2021, 4:39pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/2 "2021-05-03T16:39:48Z")

</div>

Instead of looping over all of them, you just want to turn invisible on for the status bar attached to the sprite you’re checking. Like this:

 ![Screen Shot 2021-05-03 at 9.38.31 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/6/64c9e20a90a9b5000871fd85262cfbad1d5de1f5.png)

---

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [May 3, 2021, 5:47pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/3 "2021-05-03T17:47:37Z")

</div>

Omg it seems so obvious now! Thanks.

---

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [May 4, 2021, 3:08pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/4 "2021-05-04T15:08:24Z")

</div>

I am working on a dual-type inventory system…

The first part is with text sprites and the other is with regular sprites… I am using Text Sprites for an inventory system for collectible resources (such as wood, stone, ores etc)

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

They seem to behave as lists? How can I create an array of an array so that when I want to add more ‘resource’ types, I can just append them to this list?

Best wishes  
Woody

---

<div class="post-metadata">

**Author:** ![WoodysWorkshop](https://avatars.discourse-cdn.com/v4/letter/w/ea666f/32.png) [@WoodysWorkshop](https://forum.makecode.com/u/WoodysWorkshop)\
**Post date:** [May 4, 2021, 3:09pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/5 "2021-05-04T15:09:17Z")

</div>

Here’s the updated source so far… please ignore the random floating sprites (they’re a start of my inventory components…)

> **[Tree Chopper V0.61](https://arcade.makecode.com/51152-71907-79481-69708)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [May 4, 2021, 4:22pm UTC](https://forum.makecode.com/t/while-overlapping-chopping-trees-status-bars-and-hud/7788/6 "2021-05-04T16:22:28Z")

</div>

@WoodysWorkshop you can just place another array block inside of the first one! We actually did something like this [on stream yesterday](https://forum.makecode.com/t/arcade-advanced-stream-252-calendar-game-pt-1/7816). We wanted to create a schedule where each day of the week had an array of numbers. Here’s what that code looked like:

 ![Screen Shot 2021-05-04 at 9.19.47 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/98fcc0b0157e2679173046bb388465b09e37f687.png)

The inner loop in this case is filling each day of the week with “-1” which we decided meant “nothing is scheduled”
