city41 / smaghetti

A web based level editor for Super Mario Advance 4, the GBA port of Super Mario Bros 3
https://smaghetti.mattgreer.dev
GNU Affero General Public License v3.0
48 stars 8 forks source link

Cell entities that differ based on position should not be cell entities #137

Closed city41 closed 3 years ago

city41 commented 3 years ago

createLevelData is greedy on cells in the x direction. Usually this is fine, but it can cause issues such as this level:

image

Ending up like this once played:

new level_1 (5)

This is because createLevelData divided up the water into three rects trying to maximize x. If it had maximized y instead, the result would be what the user expected to see.

Allow entities to indicate they prefer greediness on a certain axis to fix this issue.

city41 commented 3 years ago

hmm, well allowing PoolOfWater to choose its greediness does help:

image

But doesn't solve the problem. The true fix might be to kill the notion of cell based entities altogether and instead a pool of water is created by using drag handles

city41 commented 3 years ago

The real solution is ChoppyWater, PoolOfWater, Waterfall and Lava should not be cell entities.

city41 commented 3 years ago

This was fixed with 9dde7f75d1889e77d16906e621205cc3e3618f36