3 ms·
Moving your player means only changer its relative order to a few blocks, so even a bubble sort will do at most a few swaps (typically 0 or 1 swap per frame unl
by bestouff 3y ago
Moving your player means only changer its relative order to a few blocks, so even a bubble sort will do at most a few swaps (typically 0 or 1 swap per frame unless it moves many blocks per frame) so yes, it should be inexpensive.
And you don't need to run the full bubble sort on all blocks, just on the 2 blocks adjacent to the player (in the sorted list), and repeat until stabilized.
Edit: I'm not sure about the symmetry thing though. You're sorting into a cone, so maybe there are cases where you're not symmetrical at all.
- vanderZwan 3y agoIt's an isometric game, so the viewport is not a cone projection but a cube.