I have a method here that I call within my update method to return true when my player collides with a certain tile.
if (!CheckCollision())
{
player.Update();
}
private bool CheckCollision()
{
foreach (CollisionTile tile in map.CollisionTiles)
{
if (tile.TileType == "stone" && player.rectangle.Intersects(tile.Rectangle))
{
return true;
}
if(tile.TileType == "water" && player.rectangle.Intersects(tile.Rectangle))
{
return true;
}
}
return false;
}
When I collide with a tile my player will stop, but if I move in a different direction my player won't move. I'm stuck on how to figure out a way to make my player move again.