Okay the problem I was having is that it won't go down once we jumped.
This is normal because I am only telling it to go down once we're no longer jumping.
However, we won't be jumping once we reached the ground. A simple solution would be adding a second boolean like so:
public void Jump()
{
if (Jumping == false)
{
GravityBool = false;
Jumping = true;
for (int i = 0; i < 8; i++)
{
if (!Colliding(0, -i))
{
this.PositionPixelY -= i;
CalculatePositions();
}
}
GravityBool = true;
}
}
public void Gravity()
{
if (!Colliding(0, MovingSpeed) && GravityBool)
{
this.PositionPixelY += MovingSpeed;
CalculatePositions();
}
else
{
Jumping = false;
}
}
Thanks Codeproject once again for letting my mind having a bit of peace by uploading this problem, and I sorted it out a bit later.