is there a way to output that data?
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.
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
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
}
@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];
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
Inside your button handler you are accessing this sprite data property:
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)
thank you, i forgot to change it to āSteeringSpeedā so it didnāt work
hey @richard how do class work
or can you send me a link to somewhere that explains how to use them
@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
hey @richard in a translator/convertor extension, iām making a block that changes money value from type A to type B
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
If you do //% block="US dollar"
above each entry it will change how it shows up in the dropdown
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!
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?
oh no! thatās awful⦠pinging @eanders to follow up!
Sometimes while making projects, makecode can go kind of crazy and make a million copies, maybe your code is somewhere in another copy project�
Honestly I have Like Many (and I mean many) duplicate project and most of them donāt match with their title
I remember if you deleted your history makecode used to delete all your projects, but Iām pretty sure thatās fixed now.