# Sprite overlap with lava dies

**URL:** <https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619>\
**Category:** Help\
**Created:** [January 27, 2023, 12:07am UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619 "2023-01-27T00:07:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bee](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bee](https://forum.makecode.com/u/bee)\
**Post date:** [January 27, 2023, 12:08am UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619/1 "2023-01-27T00:08:00Z")

</div>

I have a student who’s sprite loses all their lives when it contact lava, instead of just 1 life. When I swap out the sprite for a smaller one, it doesn’t have the same issue. I’m pretty sure it’s got to do with the size of this sprite, but I can’t figure out how to get the sprite to respawn and only lose 1 life.

Thanks!

> **[monkey](https://arcade.makecode.com/S47373-92109-02265-16053)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [January 27, 2023, 2:39am UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619/2 "2023-01-27T02:39:18Z")

</div>

it probably is the size. I think the size of the sprite makes it contact multiple lava tiles.

---

<div class="post-metadata">

**Author:** ![hassan](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/hassan/32/1457_2.png) [@hassan](https://forum.makecode.com/u/hassan)\
**Post date:** [January 27, 2023, 2:56am UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619/3 "2023-01-27T02:56:13Z")

</div>

This is what is happening. There might be a cleaner way to do this, but you could remove the life in an onGameUpdate block instead like so:

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

---

<div class="post-metadata">

**Author:** ![bee](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bee](https://forum.makecode.com/u/bee)\
**Post date:** [January 27, 2023, 11:09pm UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619/4 "2023-01-27T23:09:54Z")

</div>

Thanks so much! This looks like a good place to start. I appreciate the idea, and I’ll go play with it.

---

<div class="post-metadata">

**Author:** ![personalnote](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/personalnote/32/31359_2.png) [@personalnote](https://forum.makecode.com/u/personalnote)\
**Post date:** [January 30, 2023, 5:21pm UTC](https://forum.makecode.com/t/sprite-overlap-with-lava-dies/17619/7 "2023-01-30T17:21:54Z")

</div>

There is a problem with this. If the player overlaps more than 1 lava tile at once, then they will still lose \>1 lives.
