# I found lots of bugs!

**URL:** <https://forum.makecode.com/t/i-found-lots-of-bugs/5767>\
**Category:** Help\
**Created:** [January 26, 2021, 6:31pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767 "2021-01-26T18:31:22Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 6:31pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/1 "2021-01-26T18:31:22Z")

</div>

> **[Sam the Hamster](https://arcade.makecode.com/23100-97422-52012-85723)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

This game proves a lot of bugs. First of all, some statements will only work as intended if used backwards, second, the tilemap will not update if it is going to be changed to a tilemap with the same asset as the one before. There are probably even more while you check this game.  
@richard  
@shakao  
@darzu  
@livcheerful

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [January 26, 2021, 6:54pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/2 "2021-01-26T18:54:10Z")

</div>

Oh no! Which of the statements don’t work unless they are used backwards? I’m not sure I understand what you mean about the assets–right now I see three levels in the game, and when I play through the tilemap switches for each level. Which asset were you trying to set it to?

(Also this game is great! I love the rings and the hamster curling up into a ball when you jump 😃 )

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 6:57pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/3 "2021-01-26T18:57:43Z")

</div>

Not when passing the level, but when reseting it. If I try to make it turn into the same tilemap as the last, it will not do anything. The comparason that is off is the one with the spike overlap.

---

<div class="post-metadata">

**Author:** ![xavvvvvv](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/xavvvvvv/32/15324_2.png) [@xavvvvvv](https://forum.makecode.com/u/xavvvvvv)\
**Post date:** [January 26, 2021, 7:04pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/4 "2021-01-26T19:04:57Z")

</div>

bugs?

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [January 26, 2021, 7:08pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/5 "2021-01-26T19:08:35Z")

</div>

Ah okay, so part of the problem is this:

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

When you use the “replace all” block, it changes the tilemap in the array also, so when you reset the level there are no rock/starter tiles and the hamster does not move back to the start. Since the hamster doesn’t move back, it keeps overlapping with the spikes, so the spike code is called several times in a row and the game ends. If you remove the replace all block, the spike overlap code should reset the level!

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 7:09pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/6 "2021-01-26T19:09:17Z")

</div>

Not the game, but on the latest makeCode. It was recently updated. I also tend to find lots of bugs on anything for some reason ಠ\_ಠ

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 7:12pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/7 "2021-01-26T19:12:29Z")

</div>

Not that the game ends, but that it subtracts more than it should. The how much to subtract comparison will no do anything unless it is on one certain order

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [January 26, 2021, 7:16pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/8 "2021-01-26T19:16:20Z")

</div>

Does this do what you want it to?

> **[Sam the Hamster](https://arcade.makecode.com/56354-35447-04626-38843)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

From the code, it looks like if the player has between 1 and 10 points, subtract 10 points and reset the level. If the player has more than ten points, subtract all their points and reset the level. Is that right?

---

<div class="post-metadata">

**Author:** ![xavvvvvv](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/xavvvvvv/32/15324_2.png) [@xavvvvvv](https://forum.makecode.com/u/xavvvvvv)\
**Post date:** [January 26, 2021, 7:22pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/9 "2021-01-26T19:22:42Z")

</div>

Oh, I see.

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 7:22pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/10 "2021-01-26T19:22:46Z")

</div>

No, It subtracts 10 if you have at least ten, or it subtracts all you have. When you fall of the screen or lose a life should be when you reset.

---

<div class="post-metadata">

**Author:** ![shakao](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shakao/32/113_2.png) [@shakao](https://forum.makecode.com/u/shakao)\
**Post date:** [January 26, 2021, 7:35pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/11 "2021-01-26T19:35:51Z")

</div>

Oh I see! Okay, a few small things:

Since the score is technically 100 points for every ring, it should check that `score > 0` and `score > 1000` (more than 10 rings) when subtracting 10:

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

The second thing is that after the player hits the spike there is knockback, which does mostly prevent double-overlaps, but we recently added some sprite flags that should also help. You can do something like this, which will make the player invincible for half a second

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

Does that get the behavior you’re looking for?

Code: [https://makecode.com/\_U8rCMEJkabdb](https://makecode.com/_U8rCMEJkabdb)

---

<div class="post-metadata">

**Author:** ![Agent\_14](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/agent_14/32/17567_2.png) [@Agent\_14](https://forum.makecode.com/u/Agent_14)\
**Post date:** [January 26, 2021, 7:40pm UTC](https://forum.makecode.com/t/i-found-lots-of-bugs/5767/12 "2021-01-26T19:40:29Z")

</div>

yes I forgot about the 100 score (facepalm)
