I'm developing a 2D platform game using the Godot Engine, with a 4K resolution. I'm unsure about how to make the game adapt to different display resolutions, as I've noticed in my gaming experience that games often have different resolution settings. Is this something implemented within the game engine? If so, how can I achieve this?
Due to the game not being a traditional pixel game, all in-game numbers are quite large (my character is 256x256 pixels, for example; the gravity is currently set to 12000), which is causing me some confusion.
I'm considering setting up a getter function to calculate the world coordinates and pixel ratio based on the game's resolution when first accessed. Then, returning a constant (the ratio of world coordinates to pixels at different resolutions, referred to as a scaling constant). Afterwards, I would enforce the physics interface to multiply by this scaling constant, thus creating a physics interface based on world coordinates.
I came across the function get_pixels_per_meter() while searching for "pixel" and "meter" keywords. Can it help me obtain the current world's pixels per meter ratio?
Thank you!