So I currently have a basic tile collision however, once collided, it doesn't set back to true unless im inside the collision, any ideas on how to improve this?
for (int i = 0; i < obj.size(); i++)
{
if (BoundingBox().intersects(obj[i].rect))
{
if (obj[i].name == "solid")
{
if (playerSprite.getPosition().x < obj[i].rect.left)
{
canMoveRight = false;
}
else
{
canMoveRight = true;
}
}
}
}