Normally to set a boundary at a certain area, I would implement something like:
if(player.X > 400){
player.X = 400;
}
This acts as though there is a vertical line at X=400, blocking movement beyond that. I’m wondering how I would implement at boundary for an area that is at a slant or diagonal rather than vertical/horizontal.
Hope I answer your question instead of making assumptions about what you are trying to achieve and suggesting a physics engine.
Anyways I would suggest using a line equation and the MathHelper.Clamp function
So now you can get the x boundary for the y value of your Player
Or the x boundary from the y value of you Player