Pixels To Grid and Vice Versa

Does anyone know the formula to turn Pixels into the Grid numbers in the editor and vice versa? I need this because I’m going to try to make a random dungeon type of thing but the spawner behavior doesn’t use the grid numbers in Flowlab.

3 Likes

I have the same issue with my Geo Dash clone for its level editor.

2 Likes

Has anyone found the formula for this yet?

I know a grid space in the editor is 32 pixels by 32 pixels.

So, if you’re spawning premade rooms using a ton of spawners, you can just manually calculate out the location and multiply it by 32 pixels to get the location in the editor in pixels.

2 Likes

So would I manually calculate the location pixel-wise or grid-wise?

In a random generation test that I was using, I had an entire room set up in a bundle using like 30 or so spawners. (Which is why I suggested mass object spawn in a previous post)

And then it’s inside of an object that randomly moves around spawning segments, making sure to avoid nearby segments so it doesn’t overlap.

Then it’ll calculate the current X and Y position (Which should already be in pixels) and you use that to set a base for every spawn behavior. Then just manually add or subtract using a multiple of 32 using expressions so that every spawned object is spawned on an actual grid space instead of just randomly.

1 Like

Would it be possible to use 1 spawner to generate an entire room? I wanted to make things look clean so I was going to store the positions in a bundle and have them change everytime a new block was spawned in the room therefore using just one spawner.

It depends on how you are doing it.

On the Site: 012 incident, go to level 5 and it’ll show a system that I had attempted.
Flowlab Game Creator - The Site: 012 Incident

This explains a bit more on what I did.

1 Like

I don’t think you can spawn multiple objects using one behavior.
That’s why I suggested an idea to do this. Being able to select an area of objects and being able to spawn that section using only one spawner. You currently have to have a spawner for every individual object, which is why not a lot of people dabble in decent random generation for top-down games.
Chunk Load, Spawn Multiple Objects at Once - Feature Requests - Flowlab Community

I don’t know if this will ever become a feature in the future but considering you can copy and paste sections within the map editor, you can copy and save large quantities of objects as an ID or code. So, I suggested a way to do this during the game instead of just the editor.

2 Likes

Since I’m too lazy to do true random rooms, I just have 5 premade rooms that are built upon exiting a previous room.


I was going to do this have have the position change every time, but I guess I could also do multiple spawners. I just have to have enough patience.
image

I was wanting to use random generation for Refraction, but considering it’s now an isometric game, I can only image the headaches that’ll cause.

There are definitely easy and hard ways to make random generation. I can definitely help since I have experimented in it before, but I have to head to class so I probably won’t be back on for another two hours or so.

1 Like

Alright, well see you later ManiacPumpkin!

pixels / 32 = blocks
blocks * 32 = pixels

2 Likes

@Flying_Fajita

Turning grid spaces into pixels isn’t accurate.
image
(That isolated block is meant to be connected to the chain of blocks ot the side)

Do you know how to fix this?

ohhh my bad I forgot, you need to also add 16, (half a block) for it to be in the center of the block.
@DeadlyGumChewer
so
pixels/32 + 16 = blocks

sorry

1 Like

Thank you!