Quantcast
Channel: Questions in topic: "chunks"
Viewing all articles
Browse latest Browse all 165

2D Circular Array

$
0
0
Hello guys, this one is really hard to understand for me. My current approach of storing level data is to always have 8x8 Chunks and each chunk has a 2d-Array of bytes representing each block in this chunk. So when the player moves to the right, I check if chunks are out of sight and move them to the position where they're missing, and recalculate it depending on his position. Now this isn't a good solution because I have to check neighbor chunks very often, so to get the data from it I would have to search for the chunk first. Then I've read about circular buffers. [This][1] and [this][2] and many google searches are what I've done right now, but I have still no clue how they work, or how I could implement them. Does anyone have experiences with circular buffers to store this type of data? I would really appreciate every answer! [1]: http://blokworld.forumotion.co.uk/t6p45-lighting-technique [2]: http://blokworld.forumotion.co.uk/gallery/General-Images/2d-Circular-buffer-pic_14.htm

Viewing all articles
Browse latest Browse all 165

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>