# Help with Bad Guys!

**URL:** <https://forum.makecode.com/t/help-with-bad-guys/10725>\
**Category:** Arcade\
**Created:** [November 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/help-with-bad-guys/10725 "2021-11-02T15:35:22Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LukaBakio](https://avatars.discourse-cdn.com/v4/letter/l/b5a626/32.png) [@LukaBakio](https://forum.makecode.com/u/LukaBakio)\
**Post date:** [November 2, 2021, 3:35pm UTC](https://forum.makecode.com/t/help-with-bad-guys/10725/1 "2021-11-02T15:35:22Z")

</div>

> **[Landon's Adventure](https://arcade.makecode.com/08982-02206-29725-04685)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

I’ve pasted my game above. The problem I’m having is that I’ve coded the bad guys (Bumpers) to die when I jump on top of them. It works with all of them except for my first bad guy. The first bad guy just dies regardless of where I over lap with him.

Please help!

Thanks!

---

<div class="post-metadata">

**Author:** ![livcheerful](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/livcheerful/32/3509_2.png) [@livcheerful](https://forum.makecode.com/u/livcheerful)\
**Post date:** [November 5, 2021, 8:19pm UTC](https://forum.makecode.com/t/help-with-bad-guys/10725/2 "2021-11-05T20:19:09Z")

</div>

hi!

The issue was in your overlaps code! In your check to see if the y is less than the enemy, your variable was looking at the last Bumper you created, instead of the Bumper that you were overlapping with! To fix it, I dragged out the ‘otherSprite’ variable from the overlaps event

Here are the before and after of the changes I made:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/5/571df17c302860884a4483352e38cffe8aee6e8b.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/d/d85f67180b4b8558ea49a59492b5060c5defd191.png)

It was working from happenstance - the other bumpers all had the same y value 😃 so it didn’t matter that it was only checking the last created one!

Hope this helps! here’s the fixed code:

> **[Landon's Adventure - bUMPERS ARE EVIL!](https://arcade.makecode.com/37812-32961-62580-30820)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

– vivian
