# Maths game, some work, some don't

**URL:** <https://forum.makecode.com/t/maths-game-some-work-some-dont/45453>\
**Category:** Arcade\
**Tags:** game\
**Created:** [August 18, 2026, 3:22am UTC](https://forum.makecode.com/t/maths-game-some-work-some-dont/45453 "2026-08-18T03:22:29Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodgo1983](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@rodgo1983](https://forum.makecode.com/u/rodgo1983)\
**Post date:** [August 18, 2026, 3:22am UTC](https://forum.makecode.com/t/maths-game-some-work-some-dont/45453/1 "2026-08-18T03:22:29Z")

</div>

Hi there, first time poster, long time MakeCoder.

I am building an example game for my year 9/10 Game Design Class and am stuck on something.

Basically, the game wants you to make a total of ten by shooting numbers that add up to ten.

Seems basic right, I agree.

I have done something wrong and am confused why when I shoot some numbers, they add to the total, but others just get destroyed and dont add to the total.

I have tried laying it out in three different ways but i get the exact same result each time.

Any ideas people?

> **[Friends of Ten](https://arcade.makecode.com/69604-26684-49486-26776)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [August 18, 2026, 3:29am UTC](https://forum.makecode.com/t/maths-game-some-work-some-dont/45453/2 "2026-08-18T03:29:14Z")

</div>

Each time you spawn a new numeral, you lose track of the previous one of that value.

For example, let’s say you’ve created a “2.” When you make another “2,” the `2` variable only points to the most recent one and loses track of the first one. So, when you do your comparison in `on destroyed,` only the most recent “2” would get caught by the `if` statement.

You’ll want to use the `sprite-data` extension. Assign a value to the sprite’s data and then use that information when checking the destroyed sprite.

~~Gimme a few minutes and I’ll create a demo project for you.~~

See if this gets you there. Holler if you have any questions.

> **[Sprite Data](https://arcade.makecode.com/00130-22633-01238-17297)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

P.S. Always great to hear from educators outside of the U.S.!

---

<div class="post-metadata">

**Author:** ![AlexK](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/alexk/32/33339_2.png) [@AlexK](https://forum.makecode.com/u/AlexK)\
**Post date:** [August 18, 2026, 10:02am UTC](https://forum.makecode.com/t/maths-game-some-work-some-dont/45453/3 "2026-08-18T10:02:32Z")

</div>

There’s another way to do this that doesn’t use the `sprite-util` extension, and that’s to use the sprite’s image in a conditional; _i.e._, check if the image is a “1,” a “2,”, etc.

Here’s the same project as above, but without the `sprite-util` extension. This one is closer to the spirit of what you had attempted originally.

> **[Sprite Data #2](https://arcade.makecode.com/76801-92686-78700-73887)**
>
> Made with ❤️ in Microsoft MakeCode Arcade.

---

<div class="post-metadata">

**Author:** ![rodgo1983](https://avatars.discourse-cdn.com/v4/letter/r/848f3c/32.png) [@rodgo1983](https://forum.makecode.com/u/rodgo1983)\
**Post date:** [August 18, 2026, 10:03am UTC](https://forum.makecode.com/t/maths-game-some-work-some-dont/45453/4 "2026-08-18T10:03:56Z")

</div>

Uh huh, i suspected something along those lines but was stuck on how to move on from there.

Also, many thanks for the detailed and down to earth explanation.

I also appreciate the example you popped in there.

I appreciate it.

Just noticed your PS, thanks.

Yeah, from Bendigo, Victoria in Australia.
