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
How to run CPU intensive parallel tasks with Vert.X in Java
How to pass ArrayList of different types to method?
Finding the last two digits before the decimal point for the number (4+sqrt(11))^n
Printing JTextArea [closed]
Number stored as text warning in excel using POI
How to atomically check TWO AtomicBooleans in Java in one safe operation without a synchronized block (i.e. low cost locks)?
Change default charset to UTF-8
Spring Javamail properties from Database
Reverse the rows of a 2d array
switching between multiple JPanels in CardLayout
Pattern Matching Algorithm for Serial Numbers
Call different methods depending on input parameters
Convert Multiset to a Map
Maven: Using a project folder as a repository for lib
Call a method before destroySession in Java?