Skip to content

Comment on The Diorama Engineparent

Comments

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.

It's an isometric game, so the viewport is not a cone projection but a cube.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.