It looks like you're new here. If you want to get involved, click one of these buttons!
Hi, one thing I've always wanted to explore is a grid-like mining/craft style game...along the lines of Terraria. I'm curious if there is any general recommendation on how to approach the world grid and maybe orx-specific hints as well! . I know it isn't a simple subject so I'm not expecting instructions on how to do it, just looking for ideas.
I don't think it is feasible to generate a bunch of orxOBJECTs for each block in the grid for performance reasons. I was thinking of keeping my world in a large 2d array of bytes, with the values representing what type of block is at that location. (1 = dirt, 2 = grass, 3 = rock , etc). For rendering, I'd loop through the visible portion of the array (dependent on player position) and render rectangles according to the values in the array. I've actually done something like that a few years back with my own home-grown stuff. Any hint as to how I could render out textures in Orx directly like that?
The other thing to handle would be collision. I feel like that also may require some custom collision handling rather than using the orx body. Since I'd know where the player is on the grid, I really only have to check a few of the values in the array that are near the player for collision. I know collision can be tricky, but think I can handle doing that part.
So, I'm curious if that sounds like a way to go, or if there are other well-known approaches? Probably the biggest unknown for me is how to render the textures directly without using orxOBJECTS (unless there is a workable approach using them)
thanks for any comment!