# Problem making enemy spawn on certain levels

**URL:** https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746
**Category:** Help
**Tags:** game
**Created:** [October 6, 2022, 6:30pm UTC](https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746 "2022-10-06T18:30:14Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Beginner\_programmer](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@Beginner\_programmer](https://forum.makecode.com/u/Beginner_programmer)
#### Post date: [October 6, 2022, 6:30pm UTC](https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746/1 "2022-10-06T18:30:14Z")

</div>

im having trouble stopping enemys from spawning at certain levels. [https://arcade.makecode.com/S54843-89948-08494-07363](https://arcade.makecode.com/S54843-89948-08494-07363) heres the code to check it out but they spawn just about at every level except the starting level

---

<div class="post-metadata">

### Author: ![SmashFangameMaker](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/smashfangamemaker/32/6868_2.png) [@SmashFangameMaker](https://forum.makecode.com/u/SmashFangameMaker)
#### Post date: [October 7, 2022, 12:28am UTC](https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746/2 "2022-10-07T00:28:33Z")

</div>

Are you using arrays?

---

<div class="post-metadata">

### Author: ![Beginner\_programmer](https://avatars.discourse-cdn.com/v4/letter/b/ed8c4c/32.png) [@Beginner\_programmer](https://forum.makecode.com/u/Beginner_programmer)
#### Post date: [October 24, 2022, 4:39pm UTC](https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746/3 "2022-10-24T16:39:55Z")

</div>

Sorry I eventually figured it out but thanks for responding. :3

---

<div class="post-metadata">

### Author: ![top\_hat\_lord](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/top_hat_lord/32/33469_2.png) [@top\_hat\_lord](https://forum.makecode.com/u/top_hat_lord)
#### Post date: [May 14, 2024, 2:33am UTC](https://forum.makecode.com/t/problem-making-enemy-spawn-on-certain-levels/15746/4 "2024-05-14T02:33:45Z")

</div>

for people who came here because they are “new” and can’t ask stuff, the way to do this is to put the data for the enemy in a function and only have the enemies get called on levels that have them, then just tamper wit how many enemies are spawned. the rest yes, is arrays. there more detail on that in youtube.
