Closed iliazeus closed 4 months ago
Very nice! Question: did this affect every vertical level, or only vertical levels that actually improved by being transposed?
In other words: because of the 3 available tile sizes, not every transposition will yield an actual improvement on the size. It will only do so if the transposition allows the use of a bigger tileset. Some transpositions will only cause the level to be rotated, but with the same tileset being used.
I like the levels being faithful to their original design in the collections, so I think it would be better if we only rotate them when that yields an improvement, and leave them with no rotation when it doesn't (although, one could argue that rotating them still produces a more aesthetic result even if no tileset change is done...).
What do you think?
Question: did this affect every vertical level, or only vertical levels that actually improved by being transposed?
Yes, it affected every level where the height was bigger than the width.
If you would like it better, we can leave the levels unchanged in the data files, and instead rotate them in the level initialization code - for example, near the part when we're deciding what cellSize
to use - and only do it if cellSize
actually improves.
I've refactored the level loading code so it calculates the optimal cellSize
only once, when loading a level, rotating it if necessary.
I've integrated the changed from #10 into this PR, but this time made the scrolling work!
Works great! Nice job, thanks!
I've merged (rebased) the changes.
Some levels (in the "Microban" back, at least) are way too small, but only take up less than half of the screen:
Screenshot: Microban, level 8
![Microban level 8](https://github.com/user-attachments/assets/8e487f4a-bff4-4f15-96f9-b8e1757c7258)This PR makes vertical levels into horizontal ones to better fit the screen.
The levels were processed by this Node.js script: https://gist.github.com/iliazeus/9fd14a338c21d5f5441a8351c955fcfe
Here's a screenshot of a rotated (well, "transposed" would be a better word) level, for comparison:
Screenshot: Microban, level 8, horizontal
![Screenshot: Microban, level 8, horizontal](https://github.com/user-attachments/assets/2312a6c6-4540-4930-917e-fd2219e8bd52)(reopened from #7 because I wanted to rename the source branch)