# Help with pixel art end math issue's

**URL:** <https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809>\
**Category:** Arcade\
**Tags:** game, graphics-and-math, make, extension, art\
**Created:** [March 27, 2023, 11:15pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809 "2023-03-27T23:15:28Z")\
**Posts on this page:** 20\
**Page:** 3

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [May 25, 2023, 3:53pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/44 "2023-05-25T15:53:43Z")

</div>

is there a way to output that data?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [May 25, 2023, 4:29pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/45 "2023-05-25T16:29:39Z")

</div>

Do you mean printing the data? console.log will do that. You should see a “show data simulator” button that appears beneath the simulator when you start calling that function. Clicking that will open the log.

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [May 26, 2023, 6:04pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/46 "2023-05-26T18:04:26Z")

</div>

hey @richard im sorry to bother you again… but do you know what im doing wrong

```auto
    //% block="Place $sprite=variables_get(mySprite) at x$X y$Y z$Z"
    export function PlaceSprite(sprite: Sprite, X: number, Y: number, Z: number) {
        let ID74696C655F7769647468 = 32
        let ID785F706978656C = ID74696C655F7769647468 * 2 - (X + Y) * ID74696C655F7769647468 / 2
        let ID795F706978656C = (Y - X) * ID74696C655F7769647468 * ID74696C655F726174696F - ID74696C655F7769647468 - 0 + ID74696C655F7769647468 * ID74696C655F726174696F - (ID74696C655F7769647468 * (ID74696C655F726174696F * (1 + 2 * ID74696C655F726174696F)) + (2 + ID74696C655F726174696F)) * Z
        sprite.setPosition(ID785F706978656C, ID795F706978656C)
        sprite.data[IsometricPlayerX] = X
        sprite.data[IsometricPlayerY] = Y
        sprite.data[IsometricPlayerZ] = Z
        console.logValue("Place Place at x.y.z", X +", " + Y + ", " + Z)
    }

```

this part just doesn’t change the data value

```auto
       sprite.data[IsometricPlayerX] = X
       sprite.data[IsometricPlayerY] = Y
       sprite.data[IsometricPlayerZ] = Z

```

how do i change the data value

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [May 31, 2023, 4:35pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/47 "2023-05-31T16:35:10Z")

</div>

hey @richard is there a way to attach a list to a enum?

```auto
let AlphabetCorversionList = "...".split(" ")
AlphabetCorversionList.push(" ")
let HexedecimalCorversionList = "...".split(" 20 ")
HexedecimalCorversionList.push("20")
let OctalCorversionList = "..".split(" 20 ")
OctalCorversionList.push("...")
let DecimalCorversionList = "...".split(" 20 ")
DecimalCorversionList.push("...")
let BinaryCorversionList = "...".split("0010000")
BinaryCorversionList.push("...")
let MorseCodeCorversionList = "...".split(" ")
MorseCodeCorversionList.push("...")

enum CorversionLists {
    Text = AlphabetCorversionList,
    Hexedecimal = HexedecimalCorversionList,
    MorseCode = MorseCodeCorversionList,
    Octal = OctalCorversionList,
    Binary = BinaryCorversionList
}

```

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [May 31, 2023, 4:41pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/48 "2023-05-31T16:41:58Z")

</div>

@YuHayate you can’t assign lists to enums, but you can map them using either a function or an object

```typescript
let AList = [1,2,3]
let BList = [4,5,6]

enum Foo {
    A,
    B,
}

// For this type of thing I typically use a function with a switch
// statement
function getList(arg: Foo): number[] {
    switch (arg) {
        case Foo.A:
            return AList;
        case Foo.B:
            return BList;
    }
}
let myValue1 = getList(Foo.A)

// But you can also use an object like this
let listMap = {
    [Foo.A]: AList,
    [Foo.B]: BList
}
let myValue2 = listMap[Foo.B];

```

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [June 2, 2023, 11:02pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/49 "2023-06-02T23:02:31Z")

</div>

hey @richard im making a racing game [https://makecode.com/\_MaJfUED37U6Y](https://makecode.com/_MaJfUED37U6Y)  
but whenever i want to turn the car disappear it use to work but not anymore

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 5, 2023, 5:34pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/50 "2023-06-05T17:34:53Z")

</div>

Inside your button handler you are accessing this sprite data property:

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

But I don’t see you ever assigning that anywhere. If you never assign TurningSpeed then it will be undefined which will cause angle to become NaN (not a number)

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [June 5, 2023, 7:37pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/51 "2023-06-05T19:37:31Z")

</div>

thank you, i forgot to change it to “SteeringSpeed” so it didn’t work

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [June 14, 2023, 5:04pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/52 "2023-06-14T17:04:05Z")

</div>

hey @richard how do class work  
or can you send me a link to somewhere that explains how to use them

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 14, 2023, 5:48pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/53 "2023-06-14T17:48:09Z")

</div>

@YuHayate that’s a little tough to explain in a couple sentences! I talked it over with @jwunderl though and we’ll do a special stream on Friday where we go over the basics of classes

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [June 26, 2023, 7:38pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/54 "2023-06-26T19:38:37Z")

</div>

hey @richard in a translator/convertor extension, i’m making a block that changes money value from type A to type B  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/b/bd0f76b0cf685c68d921a22244fa9291b0f8d11d.png)  
like so  
but there all in three letters so how do i make it so that when a hover over it it with the mouse  
it chose what it means

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/99616b986cb4c16642aed15de031fffd08744501.png)  
like the //% name of currency

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 27, 2023, 7:40pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/55 "2023-06-27T19:40:09Z")

</div>

If you do `//% block="US dollar"` above each entry it will change how it shows up in the dropdown

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [June 29, 2023, 4:41pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/56 "2023-06-29T16:41:04Z")

</div>

Yep, that’s it. It’s noted in the [documentation](https://makecode.com/defining-blocks)

> - the `block` attribute can be used to override the rendered string

You can also find more information on the Block Playground, where it’s easy to test extension. I recommend checking it out, it really makes it a lot easier to debug your extensions!

[https://makecode.com/playground](https://makecode.com/playground)

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [July 3, 2023, 5:08pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/57 "2023-07-03T17:08:55Z")

</div>

hey @richard for some reason in a game i was making everything just disappeared and now i lost my game, do you know what could’ve happened?

---

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [July 3, 2023, 5:20pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/58 "2023-07-03T17:20:38Z")

</div>

oh no! that’s awful… pinging @eanders to follow up!

---

<div class="post-metadata">

**Author:** ![Sarge](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/sarge/32/19590_2.png) [@Sarge](https://forum.makecode.com/u/Sarge)\
**Post date:** [July 6, 2023, 9:10pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/59 "2023-07-06T21:10:00Z")

</div>

Sometimes while making projects, makecode can go kind of crazy and make a million copies, maybe your code is somewhere in another copy project…?

---

<div class="post-metadata">

**Author:** ![YuHayate](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/yuhayate/32/8275_2.png) [@YuHayate](https://forum.makecode.com/u/YuHayate)\
**Post date:** [July 7, 2023, 3:13pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/60 "2023-07-07T15:13:57Z")

</div>

na, i try to keep my project count low  
right now i have 18 projects

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

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 7, 2023, 4:02pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/61 "2023-07-07T16:02:09Z")

</div>

💀 💀 💀

![2023-07-07 11-55-45](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/7/778e4f102730e3cf8b6f516d644898abdba5d5e5.gif)

---

<div class="post-metadata">

**Author:** ![Maketendo](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/maketendo/32/27571_2.png) [@Maketendo](https://forum.makecode.com/u/Maketendo)\
**Post date:** [July 7, 2023, 9:35pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/62 "2023-07-07T21:35:59Z")

</div>

Honestly I have Like Many (and I mean many) duplicate project and most of them don’t match with their title 💀 💀 💀

---

<div class="post-metadata">

**Author:** ![Luke](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/luke/32/32519_2.png) [@Luke](https://forum.makecode.com/u/Luke)\
**Post date:** [July 10, 2023, 4:30pm UTC](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809/63 "2023-07-10T16:30:51Z")

</div>

I remember if you deleted your history makecode used to delete all your projects, but I’m pretty sure that’s fixed now.

[Previous page](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809.md?page=2)

[Next page](https://forum.makecode.com/t/help-with-pixel-art-end-math-issues/18809.md?page=4)
