1
Window / sprite is outside of window
« on: March 07, 2022, 09:10:22 pm »
I just want to know how can you know when a sprite is outside a view when it is shotted by a character. Also the character can go to the border, so the mainview center.x can be the world min x and the same thing goes to the center y
if ((normalBullets.getPosition().x < player.getPosition().x - mainView.getCenter().x || normalBullets.getPosition().x > player.getPosition().x + mainView.getCenter().x || normalBullets.getPosition().y < player.getPosition().y - mainView.getCenter().y || normalBullets.getPosition().y > player.getPosition().y + mainView.getCenter().y))
if ((normalBullets.getPosition().x < player.getPosition().x - mainView.getCenter().x || normalBullets.getPosition().x > player.getPosition().x + mainView.getCenter().x || normalBullets.getPosition().y < player.getPosition().y - mainView.getCenter().y || normalBullets.getPosition().y > player.getPosition().y + mainView.getCenter().y))