# I need some help

**URL:** https://forum.makecode.com/t/i-need-some-help/5008
**Category:** Help
**Created:** [December 14, 2020, 10:09pm UTC](https://forum.makecode.com/t/i-need-some-help/5008 "2020-12-14T22:09:44Z")
**Posts on this page:** 19
**Page:** 1

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 14, 2020, 10:09pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/1 "2020-12-14T22:09:44Z")

</div>

So, I made a game on Makecode. It’s called Philip the flathead, and everything seems to be going smoothly, all except for the enemies. I tried making something simple in creating them, but it doesn’t seem to spawn where I need them to. In fact they don’t spawn whatsoever. Can somebody please look it over and tell me what I did wrong?

Link to the game:

> **[platformer](https://arcade.makecode.com/61109-11012-41512-19876)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [December 14, 2020, 10:31pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/2 "2020-12-14T22:31:48Z")

</div>

Nice platformer game. I will try to see what is going on.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [December 14, 2020, 10:55pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/3 "2020-12-14T22:55:01Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/0/09c70657e33747b400fa40da15126b5fa493d6aa.png)  
Also you never put walls here at the bottom of level 3. No wonder why I kept falling there.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [December 14, 2020, 10:55pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/4 "2020-12-14T22:55:12Z")

</div>

I have found about your problem!  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/2/2335d27329c6388fedd7ee75a09b4b156e3e79bd.png)  
You never made any enemies so why would they pop up in a game

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 14, 2020, 11:24pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/5 "2020-12-14T23:24:06Z")

</div>

Now, I have a new problem. I made some code for the enemies to change direction when a wall is in front of them, but all they do is continue to go left.

 ![Screenshot 2020-12-14 151207](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/70f900aa030cddd61e232c07e5e94f9c1ac625ef.png)

What could I do to make them change direction?

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 14, 2020, 11:24pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/6 "2020-12-14T23:24:13Z")

</div>

Oh, I see. Thanks, man. Also, the grey tiles you keep falling through are meant for you to fall through. I did that on purpose as a kind trick for the player. You can tell the difference between these tiles and the other brick tiles based off the bottom.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [December 14, 2020, 11:27pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/7 "2020-12-14T23:27:36Z")

</div>

Ahhhh. That makes sense. The game is really cool. I like the animations and stuff. Too cool. Your farmer guy is cool. I forgot his name though… Nevermind found it. His name is philip. Well I’m here if you need any help soooooo. COOL

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 14, 2020, 11:27pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/8 "2020-12-14T23:27:40Z")

</div>

> **[platformer](https://arcade.makecode.com/36251-69259-90375-48932)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![Dreadmask197](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/dreadmask197/32/10494_2.png) [@Dreadmask197](https://forum.makecode.com/u/Dreadmask197)
#### Post date: [December 14, 2020, 11:35pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/9 "2020-12-14T23:35:53Z")

</div>

Nice raining tacos enemy. I gotta eat some dinner but the enemies might need to do some more work. Make it follow and maybe use projectiles or overlaps to destroy your tacos too.

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [December 15, 2020, 7:39pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/10 "2020-12-15T19:39:00Z")

</div>

```
when hitting a well (when hitting a *wall*)

```

Since you referred to the speed of the enemies multiple times (-30), I also just created a variable called ‘enemySpeed’. You’ll notice that when an enemy hits a wall on the left, the vx is set to ‘absolute of’ (which just takes the negative speed (-30) and makes it positive).

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [December 15, 2020, 7:39pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/11 "2020-12-15T19:39:03Z")

</div>

Hi Nico,

I changed your code so that the enemies move in the other direction when hitting a well. You had written a for each loop that changed the direction, but that was only occurring within the ‘StartLevel’ method (which is called once). So I removed that code and placed in within the ‘on sprite of kind ‘Enemy’ hits wall at location’ event (you can find it under ‘Scene’ menu).

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

> **[platformer (cosmos)](https://arcade.makecode.com/83582-30056-78013-63821)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

There is one enemy all the way to the right that is stuck, but the rest move 😉

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 15, 2020, 7:54pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/12 "2020-12-15T19:54:55Z")

</div>

Thank you man, you really saved my behind 🙂

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 15, 2020, 8:23pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/13 "2020-12-15T20:23:16Z")

</div>

actually, hold up.

I copied what you did onto my original game, and made sure that I understood it of course, but when I tested it, it did the same thing as before. What did I do wrong?

> **[philip](https://arcade.makecode.com/75280-50004-51588-90907)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [December 16, 2020, 9:15pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/14 "2020-12-16T21:15:12Z")

</div>

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

Change the ‘kind’ of spite from Player to Enemy. 👍

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 16, 2020, 10:26pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/15 "2020-12-16T22:26:33Z")

</div>

> **[philip](https://arcade.makecode.com/76994-89138-03575-45862)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

So far. I have this.

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 16, 2020, 10:27pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/16 "2020-12-16T22:27:06Z")

</div>

I feel like an idiot now.

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [December 17, 2020, 10:01pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/17 "2020-12-17T22:01:07Z")

</div>

I am glad you got the game working. I noticed a few issues with the player overlap enemy event:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/a1fb3ed3d2822c2fbbc2aaf909365302949083b8.jpeg)

You need to use the variables ‘sprite’ and ‘otherSprite’ that are given at the top of the event. To use those variables, click and drag the variable to other sprite placeholders (i.e. _sprite_ to _Philip_ and _otherSprite_ to _small\_blob_). Although you are correct to assume that the only player is ‘Philip’ (which is the variable sprite), and the enemies you create are assigned to ‘small\_blob’; the problem occurs when you create multiple enemies. The last enemy created may be further to the right of the game, but it does not refer to the first one you created. Long story, I know.

This is what I changed in the event block

Philip =\> sprite  
small\_blob =\> otherSprite

Also, you were checking if the bottom of Philip was less than the y of small\_blob (well ‘otherSprite’, an enemy); which suggests you are checking if the player jumps on top of the enemy. It would be better to specify ‘player bottom’ is less than or equal to the ‘enemy top’. However, your enemies were 16 pixels in height, but only 7 pixels tall. The top measurement takes into account the transparent pixels (i.e the pixels not having any color) that are above the enemy. I changed the height of the enemies to 7 pixels.

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

1. Select the boundary of the sprite
2. Drag it to the top
3. Change the height from 16 to 7

Even when I changed that, I noticed that the overlap event was not working as expected, so I changed the condition to be:

if (sprite.vy \> 0) (the player sprite is falling down), then the player landed on top of the enemy. I also placed the destroy at the bottom of the if statement.

> **[philip](https://arcade.makecode.com/83776-33997-47374-02817)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

### Author: ![\_nico](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/_nico/32/2760_2.png) [@\_nico](https://forum.makecode.com/u/_nico)
#### Post date: [December 17, 2020, 10:31pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/18 "2020-12-17T22:31:43Z")

</div>

I was expecting to do it myself, but I never even considered any of this. Thank you so much @cosmoscowboy. You must be from Microsoft cause you seem to know every problem and how to fix it.

---

<div class="post-metadata">

### Author: ![cosmoscowboy](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/cosmoscowboy/32/1718_2.png) [@cosmoscowboy](https://forum.makecode.com/u/cosmoscowboy)
#### Post date: [December 19, 2020, 4:40pm UTC](https://forum.makecode.com/t/i-need-some-help/5008/19 "2020-12-19T16:40:33Z")

</div>

I don’t work at Microsoft, and don’t know everything, but enough to help you out. 👍
