I want to shoot a bullet towards my mouse position but I think that my math is probably wrong since the position the bullets travel to isn't the right one. Here's my code
Vector2 bulletDirection = new Vector2(screenX - player.getX(), Gdx.graphics.getHeight() - (player.getY() - screenY)).nor();
bullet.setPosiion(player.getX(), player.getY());
bullet.translate(bulletDirection.x * flightSpeed, bulletDirection.y * flightSpeed);
Can you tell me what I'm doing wrong? The "bullet" object is my current bullet sprite