Updates YOU want to see in Makecode

UInt32 and such don’t exist, it always throws an error.

HI STUDIO AGAIN!
i want it so in raycasting extention, non-walls are the floor. maybe a sky colour too.
maybe a block like [ Replace all {Tile} with {sprite} ] I think it would be handy if you have a lot of coin entities to make (like in my game “Ninja Legends”)

wait that wasnt really clear, but all the typed arrays are:

Typed Array Class Element Type Size (Bytes) Range
Int8Array 8-bit signed integer 1 -128 to 127
Uint8Array 8-bit unsigned integer 1 0 to 255
Uint8ClampedArray 8-bit unsigned integer (clamped) 1 0 to 255 (clamps overflows)
Int16Array 16-bit signed integer 2 -32,768 to 32,767
Uint16Array 16-bit unsigned integer 2 0 to 65,535
Int32Array 32-bit signed integer 4 -2,147,483,648 to 2,147,483,647
Uint32Array 32-bit unsigned integer 4 0 to 4,294,967,295
Float16Array 16-bit half-precision float 2 -65,504 to 65,504
Float32Array 32-bit single-precision float 4 1.2 × 10⁻³⁸ to 3.4 × 10³⁸
Float64Array 64-bit double-precision float 8 5.0 × 10⁻³²⁴ to 1.8 × 10³⁰⁸
BigInt64Array 64-bit signed BigInt 8 -2⁶³ to 2⁶³-1
BigUint64Array 64-bit unsigned BigInt 8 0 to 2⁶⁴-1

(wait Gemini’s formatting copies???)

1 Like

a way for makecode to tell a function runs instantly, so that code would be more optimized.

1 Like

Well yeah, in primitive JS use, you don’t need or use them? What’s the purpose of needing a specific-sized int? You could use makecode’s fx8

Many AIs output markdown, so when you copy to clipboard it gets copied as rich text, and discourse uses markdown so it’s almost a perfect copy (able to understand all the rich text)

I doubt MakeCode does a similar thing to scratch where it runs functions with a screen refresh unless specified not to.

1 Like

I think non-walls already are the floor? If you want a sky color then set the background color to that.

that block does exist, it’s in the “tile utils” extension

1 Like

Why have I not realized that there’s an extension for literal time:

@richard get this on the home page lol. I built my own clock system that works like @TheEarth when I could have used your extension lol. :rofl:

2 Likes

Is there a way to pause the countdown? If not, there NEEDS to be a feature like this.

2 Likes

If only Richard hadn’t realized that he could make one of his own then my extension would be everywhere

Not really built in but you could have a function that stores the current countdown time and keeps re-setting it every frame (I haven’t tested this, however.)

1 Like

technically its (3 | 4) but we still know what you mean

Fx8 is a namespace/interface to handle 8-bit numbers, i still waste like 56 bits (64 bit float - 8 bits)! a Uint8Array would have no extra memory though.

I don’t really understand what you mean? But take turbowarp for example. It is just scratch but like 50x faster. I copy-pasted my raytracer into an actual js compiler, and it ran SUPER fast. (only the main function and controller was changed, not the hitbox collision or raytracer or player or anything else.) On my computer, a 140x140 on makecode ran at 14 FPS. the actual js, I had a 900x900 (81 times bigger) and it still ran fast (20 FPS)! I think the best keyword to make makecode not compile a function into a huge switch would be “sync”, like sync function add(a: any, b: any) { return a + b}, since makecode compiles because it doesn’t know if a function pause the thread or not (e.g. pause(...), waitUntil(...), etc.).

so if my functions were actually something like sync function traceRay(...), my raytracer would become roughly 53x faster.

(also i dont think i said this yet, but im making a topic on how makecode compiles.)

1 Like

(3 || 4) is also perfectly legal syntax. I was merely quoting the OP.

1 Like

I always use a game update every Ms because I like to have a refined tatse

1 Like

Fx8 is fixed-point arithmetic, no? Probably would need one of the engine devs to chime in but I was under the impression that the 8 is for 8 bits of decimal points, and 24 bits are used for the regular integer part.

Ohh, if I’m not mistaken then I guess you are talking about the compilation that happens to the code to result in binary.js so it’s a bunch of state machines and a “performance-killing” trampoline - I think it’s in the continuation-passing style so V8 can’t JIT compile/optimize/inline/etc. it well so it’s “very” slow compared to if it was just regular JS. And for that, I would definitely want the MakeCode team to speak about that instead but my guess it would be very hard to have a “synchronous” function emitted as-is while keeping the rest untouched.

Probably the only real solution is to implement more shims that handle intensive math so it doesn’t need to “bounce around” or something like that. Or compile natively something like @Kikketer’s native builds or implement the pxt64 bytecode interpreter (which I’ve been researching as well…:eyes:)

3 Likes

I think its binary.js, yes

oh… that makes more sense.

That would be a cool topic to make for some people to just find random functions that do that. (is there one already?)

1 Like