Help with pixel art end math issue's

is there a way to output that data?

2 Likes

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.

4 Likes

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

    //% 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

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

how do i change the data value

3 Likes

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

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
}
3 Likes

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

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];
4 Likes

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

3 Likes

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

image

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)

4 Likes

thank you, i forgot to change it to ā€œSteeringSpeedā€ so it didn’t work

3 Likes

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

3 Likes

@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

8 Likes

hey @richard in a translator/convertor extension, i’m making a block that changes money value from type A to type B
image
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


like the //% name of currency

3 Likes

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

5 Likes

Yep, that’s it. It’s noted in the documentation

  • 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

2 Likes

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?

2 Likes

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

4 Likes

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

2 Likes

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

3 Likes

:skull: :skull: :skull:

2023-07-07 11-55-45

7 Likes

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

4 Likes

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

1 Like