# Sprite scores offscreen

**URL:** <https://forum.makecode.com/t/sprite-scores-offscreen/26917>\
**Category:** Help\
**Created:** [February 15, 2024, 6:21pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917 "2024-02-15T18:21:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![macGyver313](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@macGyver313](https://forum.makecode.com/u/macGyver313)\
**Post date:** [February 15, 2024, 6:21pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/1 "2024-02-15T18:21:00Z")

</div>

How can I make it so that when an enemy disappears from the left side of the screen, the score decreases by 1 and the sprite then destroyes itself?

---

<div class="post-metadata">

**Author:** ![Sonicblaston](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sonicblaston/32/19164_2.png) [@Sonicblaston](https://forum.makecode.com/u/Sonicblaston)\
**Post date:** [February 16, 2024, 5:18pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/2 "2024-02-16T17:18:08Z")

</div>

For the destroying part you could add a

 ![IMG_6282](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9497d4101afa714127db932fef247cf5e0b8a063.jpeg)  
Press the “X” and change it to lifespan  
 ![IMG_6283](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/4/49be0205a77302478ca48920fa89dda5da117e1b.jpeg)  
Then you change the number to what how long it takes for it to auto destroy. (You have to write the time in milliseconds: 1 second= 1000 milliseconds)

---

<div class="post-metadata">

**Author:** ![robotosaurus](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/robotosaurus/32/19294_2.png) [@robotosaurus](https://forum.makecode.com/u/robotosaurus)\
**Post date:** [February 16, 2024, 5:23pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/3 "2024-02-16T17:23:25Z")

</div>

Just take the x pos and run some code if it’s less than 0.

---

<div class="post-metadata">

**Author:** ![Mega0star01](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/mega0star01/32/14784_2.png) [@Mega0star01](https://forum.makecode.com/u/Mega0star01)\
**Post date:** [February 16, 2024, 5:23pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/4 "2024-02-16T17:23:31Z")

</div>

do a sprite like a stick, put it in position and then do the code so when the enemy overlaps the stick score changes and the enemy sprite disappears.

---

<div class="post-metadata">

**Author:** ![Jedi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/jedi/32/14307_2.png) [@Jedi](https://forum.makecode.com/u/Jedi)\
**Post date:** [February 16, 2024, 5:24pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/5 "2024-02-16T17:24:04Z")

</div>

here i made an example for you  
just change the code a bit for your needs and your good to go!

> **[example](https://arcade.makecode.com/86181-29036-17283-97856)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

btw welcome and i like your username! (my little sister is OBSESSED with macgyver)

---

<div class="post-metadata">

**Author:** ![MeatballDev](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/meatballdev/32/28502_2.png) [@MeatballDev](https://forum.makecode.com/u/MeatballDev)\
**Post date:** [February 16, 2024, 5:26pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/6 "2024-02-16T17:26:19Z")

</div>

Can I see your game I am bad at explaining. Btw, Welcome

---

<div class="post-metadata">

**Author:** ![macGyver313](https://avatars.discourse-cdn.com/v4/letter/m/71c47a/32.png) [@macGyver313](https://forum.makecode.com/u/macGyver313)\
**Post date:** [February 22, 2024, 5:47pm UTC](https://forum.makecode.com/t/sprite-scores-offscreen/26917/7 "2024-02-22T17:47:36Z")

</div>

Great, thanks!
