Alright, so whenever I call Gdx.input.getMouseX(); and test it out, I get insanely high numbers even though my screen width is 480. Now, the beginning (left) is still 0, but the end (right of screen) goes almost to 30,000. I’m not using Cameras or anything for my game so could that be the problem?
I cut off unimportant parts of this code.
public class Player {
private int x = 480 / 2, y = 100, reviveTime = 0;
private Rectangle rect;
private Texture playerTexture;
private SpriteBatch batch;
public boolean timedOut = false;
public Player() {
rect = new Rectangle(x, y, 32, 32);
Texture.setEnforcePotImages(false);
playerTexture = new Texture(Gdx.files.internal("data/Graphics/Orb.png"));
batch = new SpriteBatch();
}
public void render() {
batch.begin();
batch.draw(playerTexture, x, y);
batch.end();
}
public void update() {
x = Gdx.input.getX(0)-75 /2;
rect.setPosition(x, y);
if (x < 0) {
x = 0;
}
;
if (x > 480) {
x = 480;
}
;
if(timedOut == true){
revive();
}
}