3D voxel rendering engine

what is the thing we put in to the extension finder bar to get it and is it work with blocks

there’s no blocks support yet, but in the extension in main.ts, there is some code that shows all that it does so far.

2 Likes

thats there because when you make a extension you have to add a file to your project and that’s where you make the blocks and if your project has say the Browser Events Extension added when you post the extension it will be added as well

1 Like

yes because it needs it to left/right click, and it has no blocks support. sorry!

2 Likes

you put the entire github url, or just c-minusminus/arcade-voxel-engine. It had no block support, but I might add some next update

1 Like

That would be great!!!

1 Like

next update theoretically on Apr 24th! Adds many stuff :ó ‡Ș)

3 Likes

finished the next update, the blocks are a little finicky. Everything else works fine though!

1 Like

Can’t wait to try it!

1 Like

hmm
 could you please help with my voxel engine a bit? The blocks for the player are acting kinda funny, specifically the getters/setters. I think its because there static but I’m not sure. The extension is https://github.com/c-minusminus/arcade-voxel-engine

3 Likes

@richard, whats the biggest number array length the settings extension can save/load, and are there better ways to save huge number arrays? i tried saving a 200x200x200 (8,000,000 in length) and the game crashed every time i tried. I know 8,000,000 is an unresonable amount, but it would be nice to know.

@richard is it possible to have getters/setters in namespaces? im talking about how in the Sprites class it has

//% group="Physics" blockSetVariable="mySprite"
//% blockCombine block="x" callInDebugger
//% blockCombineGetHelp=sprites/sprite/x#get
get x(): number {
    return Fx.toFloat(Fx.add(this._x, Fx.div(this._width, Fx.twoFx8)));
}
//% group="Physics" blockSetVariable="mySprite"
//% blockCombine block="x"
//% blockCombineSetHelp=sprites/sprite/x#set
set x(v: number) {
    this.left = v - (this.width / 2)
}

And when i tried doing the same in namespaces for my voxel engine, it didnt work. Is there a way to do something like this, without doing it like this:

//% group="..."
//% block="..."
export function getX() {
    return x
}

It organizes the code so much, and i dont want to not have it. Also, this is for the player which i don’t want to be a class, because there should only be one player. I could make it a class it just doesnt make much sense to me.

Can you expand on “acting kinda funny”?

hi I’m using you extension in blocks and I cannot work out how it works can you Maby please make a demo in blocks so I can see how it works

1 Like

the limit on storage is roughly 16 kilobytes.

no, it’s not possible to do that in TypeScript, though you can have static getters/setters on classes:

class Whatever {
    static get x(): number {
        return 0;
    }
}

console.log(Whatever.x)
1 Like

thanks! I did start to try that, and doing that is the error @WoofWoof . For some reason, the getters/setters want a variable for an input. rather than a Player, it wants the whole Engine! obviously the player has a position and the engine doesn’t, so it’s causing it to cause errors. doing VoxelEngine.Player.x works fine though. it’s that the blocks are doing VoxelEngine.x. Also it shouldn’t even be asking for an input, it’s a static class!

1 Like

hi how do you use the engine in block code I can’t get it to work

might make a tutorial or spring one I finish making sure it works

would this help?
MakeCode Blocks Playground

omg how is it so FAST? this is amazing!