# I cant get enemies to work properly

**URL:** https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734
**Category:** Help
**Created:** [June 19, 2023, 7:00pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734 "2023-06-19T19:00:41Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 19, 2023, 7:00pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/1 "2023-06-19T19:00:41Z")

</div>

so, here’s the deal. i’m trying to add enemies to my game, but they just… aren’t spawning. i have no idea why or how, all of my enemy code is used directly from my other games, so what gives?

> **[project hoplings: reborn! (beta 0.1.0)](https://arcade.makecode.com/56009-39630-12547-53872)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 21, 2023, 4:26pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/2 "2023-06-21T16:26:29Z")

</div>

here is the solution:

 ![Screen Shot 2023-06-21 at 11.16.22 AM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/98e4ac22801f31e1c6e2811238fc0141f9335b64.png)

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 21, 2023, 8:23pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/3 "2023-06-21T20:23:11Z")

</div>

it’s still not spawning them in.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 21, 2023, 10:09pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/4 "2023-06-21T22:09:34Z")

</div>

set myenemy to ghost through walls, not just “ghost”

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 22, 2023, 4:37pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/5 "2023-06-22T16:37:49Z")

</div>

I did, and I also gave enemybody its own sprite kind of the same name, but nothing changed.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 22, 2023, 5:02pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/6 "2023-06-22T17:02:43Z")

</div>

take out the tile on the array of all tiles and choose the flag from the built in dropdown

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 22, 2023, 6:52pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/7 "2023-06-22T18:52:07Z")

</div>

The red one that was already in the box?

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 22, 2023, 8:44pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/8 "2023-06-22T20:44:15Z")

</div>

![Screen Shot 2023-06-22 at 3.06.41 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b57e0d4846b70d48baeddbd83ea7b77b47130125.png)  
it should look like this

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 22, 2023, 8:52pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/9 "2023-06-22T20:52:29Z")

</div>

it does, but it still isnt spawning them

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 22, 2023, 10:38pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/10 "2023-06-22T22:38:29Z")

</div>

yours looks like this:  
 ![Screen Shot 2023-06-22 at 5.01.10 PM](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/025d18f5bf57ead574f94e8230549aa4773c0b74.png)  
it should be this:  
[![](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b57e0d4846b70d48baeddbd83ea7b77b47130125.png) ](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/b57e0d4846b70d48baeddbd83ea7b77b47130125.png)

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 23, 2023, 1:03am UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/11 "2023-06-23T01:03:45Z")

</div>

alright. i changed it, and the enemy is finally spawning.

…in the sky at the start of the level. dammit.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 23, 2023, 5:08pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/12 "2023-06-23T17:08:31Z")

</div>

can you send me an updated link?

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 23, 2023, 8:29pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/13 "2023-06-23T20:29:04Z")

</div>

> **[project hoplings: reborn! (beta 0.1.0)](https://arcade.makecode.com/29547-26100-15448-39963)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Brohann](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brohann/32/17380_2.png) [@Brohann](https://forum.makecode.com/u/Brohann)
#### Post date: [June 23, 2023, 9:22pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/14 "2023-06-23T21:22:37Z")

</div>

you forgot to place myenemy onto the tile

---

<div class="post-metadata">

### Author: ![Brainstorm\_Studios](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brainstorm_studios/32/20476_2.png) [@Brainstorm\_Studios](https://forum.makecode.com/u/Brainstorm_Studios)
#### Post date: [June 26, 2023, 4:58pm UTC](https://forum.makecode.com/t/i-cant-get-enemies-to-work-properly/20734/15 "2023-06-26T16:58:49Z")

</div>

But I made a line of code that makes it so myenemy’s position is constantly the same as enemybody’s position. That’s why enemybody exists. It works out all the physics while the visible sprite just animates.
