Help with sandbox game

Hi, I need help with this sandbox multiplayer game I am working on. Basically I need some sort of save function for a 5x5 grid with 4 different types of blocks. here is the link to the project, and when you send it back, just edit the title to V.Beta.1.1 and I will make sure to give credit.

link: https://arcade.makecode.com/S77293-07968-19580-11092

1 Like

Someone else might be willing to write this code for you, but I would encourage you to figure it out! All you need is to save an array of numbers that is 25 long. the first number would be the object in the top left, the last number would be the object in the bottom right.

a little broken but cool

Yes, I tried that, but I ended up with over 400 lines of code for just that. if you could tell me how that would work (Im not good with arrays), that would be great, thanks!

1 Like

Well here’s a little something. To tie it into the system you have currently you would need to make your sprite placing thing into a tile placing thing, which wouldn’t be too hard I don’t think. I would make it save whenever a tile was placed, instead of having a dedicated “save” button, just for convenience. I would also add a way to rename the “files”, just make sure they can’t name them “New Build” or things could get a bit broken.

You can see in the comment I wrote, but I made it so that a “new level” is filled with random tiles, instead of the empty tile (tile 0) which is just for demonstration purposes and should probably be changed so that the array is set to be all 0s.

1 Like

Okay thanks, but I can’t really understand that, plus I thought of another way (still switching to tilemaps btw), where I use a sprite an tp it to each tile, and use overlap blocks to detect the block types. Also, do you think you could explain how all the array blocks work? Because I would like to know how to add numbers instead of having an if block for every single thing to save it correctly.

PS: I realized that the turret is kind of a bad way of building it, so what I am going to do is make the turret its own block, then I am going to make a thing where you can’t just stack blocks forever (which is what’s been happening lol). Also I still don’t know how I would save it. if you could help me with array’s (as said above), that would be great. Thanks for the help!

1 Like

Hey, everyone who has looked at this and is interested, please refer to the devlog for this game, where I will be posting updates, and if you would like to be an official part of the team, the following will have a link to Digital Den Games (my dev team, originally named Foxhole Devs.)

Link to VectorForge Devlog: VectorForge Devlog

Link to Digital Den Games topic: Digital Den Gаmes