# My sprites are spawning inside of wall can anyone please help?

**URL:** <https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323>\
**Category:** Help\
**Tags:** game\
**Created:** [March 5, 2025, 10:16pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323 "2025-03-05T22:16:51Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 5, 2025, 10:16pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/1 "2025-03-05T22:16:51Z")

</div>

Can anybody please help me with my code. I have been trying to make a PAC-man Parody, and have struggled to get my sprites to not spawn in walls. The point and sometimes enemies are spawning in a wall. Thank you if you can.

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [March 6, 2025, 12:22am UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/2 "2025-03-06T00:22:53Z")

</div>

welcome! make sure you share your code so we can tell whats up!

---

<div class="post-metadata">

**Author:** ![ShaneyBoi09](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/shaneyboi09/32/18893_2.png) [@ShaneyBoi09](https://forum.makecode.com/u/ShaneyBoi09)\
**Post date:** [March 6, 2025, 12:26am UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/3 "2025-03-06T00:26:29Z")

</div>

If ur tilemap looks something like this

 ![Screenshot 2025-03-05 180746](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/b/0b019612d90822d143667d8237aebd6ec11b715e.png) then use this block:  
 ![Screenshot 2025-03-05 180845](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/0/50fb3017702a6accd986af0579164bb130ccd67f.png)

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [March 6, 2025, 1:09pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/4 "2025-03-06T13:09:57Z")

</div>

I’m sorry, in order to help you, could you share your code, please?  
Here’s a quick tutorial:

[![](https://img.youtube.com/vi/3DBz_0qVHf4/maxresdefault.jpg "How to share your game in Makecode Arcade") ](https://www.youtube.com/watch?v=3DBz_0qVHf4)

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 10, 2025, 4:56pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/5 "2025-03-10T16:56:35Z")

</div>

[Pacman parodie](https://makecode.com/_i4LgWLaP5Pqi)

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 10, 2025, 4:56pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/6 "2025-03-10T16:56:48Z")

</div>

That’s what the project is.

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 20, 2025, 8:54pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/7 "2025-03-20T20:54:10Z")

</div>

Its using a different style of map to that, its using bitmap instead, and the walls are actual barriers that don’t allow you to pass through

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [March 21, 2025, 10:39pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/8 "2025-03-21T22:39:32Z")

</div>

![IMG_7956](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/d/8d17df5b2088cbe9d45b817193621c4d2c340c84.jpeg)  
Something like this should work! It will also allow your enemies to spawn all over the map instead of just in the top left.

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 24, 2025, 12:26pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/9 "2025-03-24T12:26:01Z")

</div>

Thank you

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 24, 2025, 12:26pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/10 "2025-03-24T12:26:05Z")

</div>

Also how do i make it so that only one clone gets destroyed?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [March 24, 2025, 5:51pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/11 "2025-03-24T17:51:42Z")

</div>

![IMG_7998](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/0/b/0bc3aabbcf053c6076a08e7842368bb730dc15a0.jpeg)  
Instead of that use this:  
 ![IMG_7999](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/a/1a4a9624d9208dc4df351740739cf7ca1c9a5ecf.jpeg)

---

<div class="post-metadata">

**Author:** ![CODE](https://avatars.discourse-cdn.com/v4/letter/c/3d9bf3/32.png) [@CODE](https://forum.makecode.com/u/CODE)\
**Post date:** [March 26, 2025, 5:03pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/12 "2025-03-26T17:03:53Z")

</div>

That didn’t work, its still clearing all of the sprites of the same type, is there any way that it can be changed?

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [March 26, 2025, 9:33pm UTC](https://forum.makecode.com/t/my-sprites-are-spawning-inside-of-wall-can-anyone-please-help/34323/13 "2025-03-26T21:33:31Z")

</div>

You probably have the same bit of code somewhere else. I will take another look….

Ok, so you are using that “destroy all sprites of type…” block in two places:

 ![IMG_8091](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/5/7/57f82d8ce9b83aff17b89e135afd4d11715b0222.jpeg)

You need to switch them out for the normal “destroy (sprite)” block, which only destroys a single sprite, instead of a whole bunch.

First, find the correct block in the sprites tab:

 ![IMG_8095](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/0/f021c289f453abaf7ac9d2f07f187b44afec5664.jpeg)

Then replace both incorrect blocks with the correct one:

 ![IMG_8093](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/6/a/6acc247c69d270a635fd8f4bac7e18ee9f68d709.jpeg)

Then drag the correct sprite variables into the sprite spot:

 ![IMG_8092](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/6/960cb1f432566e09e894c09a6875055a015fee95.jpeg)

And now it should work!
