So I have a bullet and when I left click the bullet can fire in any direction depending on where the mouse is, however, because I have a camera and I move out of the normal screenview, using this code:
position.x = p1.player.getPosition().x + 10 - (screenDimensions.x / 2);
position.y = p1.player.getPosition().y + 10 - (screenDimensions.y / 1);
if (position.x < 0){
position.x = 0;
}
if (position.y < 0){
position.y = 0;
}
view.reset(sf::FloatRect(position.x, position.y, screenDimensions.x, screenDimensions.y));
window.setView(view);
it eventually gets to a point where I can fire up or right, my bullets shoot behind the player. Just curious if anybody knows a fix?