bool right;
bool left;
bool jump;
int G = 30;
int Force;
public Form1()
{
InitializeComponent();
}
private void timer1_Tick(object sender, EventArgs e)
{
if(player.Bounds.IntersectsWith(box.Bounds) && player.Right >= box.Left && player.Right < box.Right)
{
right = false;
}
}
This is a fragment of my code. Everything in code beside this is working correctly.
This fragment makes statement when Right side of Object Player and Left side of Object Box collide. It works but there is a little bug which I've met in many projects : This is a screenshot of collision
As you see even through objects collide and statement works and stop the player to move left, you can barely see that they still overlap slightly. This ruins and has conflict with other side collisions. I have no idea what is the problem so please, i need some answers