Use y-down coordinate system for breakout example #22
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The y-up coordinate system makes lots of logic more confusing and requires us to flip many things upside down in rendering. It's very strange. I don't think a simple example like this needs a different coordinate system anyway.
Does that hint to the need for better coordinate transform API, or is that only that it's simpler to use the default y-down in that specific example?
More generally what do you think about default top-left, y-down? I was using bottom-left, y-up before, and it does feel more natural to me when just drawing stuff, but then the top-left, y-down system is way more intuitive with UI layout stuff.
In general I prefer top-left, y-down for anything 2D or "UI-like". But I suppose it's worth thinking about how we might help with y-up use cases.
I can imagine for example that a 2D platformer would want to use y-up and have a world origin that translates around based on the camera. But such a 2D game would also want to be able to render images and text right side up without fussing.
I think the real issue is that the pong example uses the milepost graphics matrix stack as the means by which you implement "world coordinates". I don't think you actually want that. If I was making a 2D platformer I would probably do my game logic in "world coordinates", do a world space -> screen space position transformation entirely in my code, and then use the milepost graphics transforms to position things in screen space only.
I wonder how Raylib does this...