How to set Abitrary Units properly?
I'm currently working on a game where you have to avoid asteroids. I started to use arbitrary units. public final static int WIDTH = 100, HEIGHT = 100; Additionally, I'm using an OrthographicCamera: float aspectratio = 16/10; cam = new OrthographicCamera(100, 100 * aspectratio); cam.position.set(cam.viewportWidth / 2f, cam.viewportHeight / 2f, 0); cam.update(); In the game screen, the asteroids look deformed:
That's a problem of your Viewport. Have a look at this page. For example, you can use a FitViewport that scales your game as much as possible to fit the screen, but there may be black bars.
Your aspect is off. Notice your planets aren't round either. Your viewport is 500x400, which is a 5:4 aspect, you want 16:10 aspect. Try changing cam = new OrthographicCamera(500, 250 * aspectratio); to cam = new OrthographicCamera(500 * aspectratio, 500); that will give you a viewport of 800x500, or 16:10 aspect
Calendar Event via Intent does not set Start Date and End Date
Combining two accounts [closed]
Casting list of objects to list of maps in java [duplicate]
JComboBox to display multiple lines of text
RotatedRect to Java Ellipse2D or similar - OpenCV
Need to restart Java method up to three times for username & password log-in system
How can I change default elements color android layout?
Guice Request-scoped injection without a servlet (in an RPC server)
RPN Calculator Using Stacks
3D Fourier Transform using JTransforms in Android Studio
Converting RGB byte array to BufferedImage
Creating a term-by-file document matrix from a set of documents
Android POST request with JSON
Headless Selenium test which fills out a form?
How can I extract url from json data with escaped “\” in java
How to make the following sliders for a RGB program