3D voxel rendering engine

I wonder if you can make 3d sprites like then you have mobs in Minecraft!

1 Like

what about slabs like half blocks

1 Like

the player is static, also it needs to be updated a bit (@woofwoof thanks for thinking of enums! (I know how to use them from looking at mixer.ts or some sound related file))

1 Like

currently everything in the player class is static, so it doesn’t need to be created. the only issue that I can see right now is the getters and setters. In the next update it will become a namespace again, and will hopefully fix the getters and setters.

hey I noticed that the blocks have .player= if you have function name like this

//%block
export function .player=(...): void {

}

you can have a = on the block command like this

//%block="Set $voxelengine player $xy to $n"
export function .player=(...): void {

}

which lets you add spaces I just thought it was not supposed to be like “.player=” but if it is suppsed to be like that nevermind

1 Like

I will finish meeting then actually work right, then create a project with a small example of it

maybe in the future!

yes but what I made looks coloor to me

I don’t, I think it’s makecode being weird with getters/setters

first example!! https://arcade.makecode.com/S17056-69251-90166-49747
bleghghhg its so tiring making an extension…

anyways, if anybody finds a bug, or wants something added, please say! I cannot think of everything everybody wants so actually do!

also if youre in javascript the extenion should be named “arcade-voxel-engine - Copy” (idk why) and the version is 9943da6 (@richard now im interested in the hex values…)

@WoofWoof the blocks are breaking and i dont know why :sob: :sob: :sob:

1 Like
function cast<T>(v: any): T {
    return v as T
}

is there a way to turn this into a block, or do something like it as a block? @richard

nope!

you can add blocks for individual types, for example:

//% block="$a as sprite"
function castToSprite(a: any): Sprite {
    return a
}

but generics and type arguments are not supported in blocks and probably never will be

1 Like

it’s not an issue with they work, but it’s more about the //% things

1 Like

starts partying for 2 minutes straight

4 Likes

HOW??? HELPPPPPP.

:exploding_head:

1 Like

Oh nvm!!! It is kinda easy to me!

1 Like

@richard , i am still trying to add more stuff to my voxel engine, and it has been lagging recently (~12 FPS). I’ve been noticing that purposefully making it lag actually makes it get faster (~50 FPS). Why does this happen, and is it possible to “set it up” before the user actually starts playing, like part of the init function?

1 Like

i’m not sure what you mean by purposefully making it lag?

1 Like

what do you mean by that also you could just try to render what is only in view if that’s possible

1 Like

might send a video later, but also, is there anything specific that makecode is faster with? it’s hard to explain exactly what i mean, but an example is that hex buffers are faster than number arrays. Another example is Math.min vs |0, or if/else vs switch, if/else vs ?/:, and other things like that. I also know that objects make it slower (if I’m wrong plz tell me).