if (player.position.x <= pipe.position.x + pipe.width && player.position.y > pipe.position.y) {
hitPlatform = true;
jumpedOnce = false;
}
if (player.position.y + player.height <= pipe.position.y && player.position.y + player.height + player.velocity.y >= pipe.position.y && player.position.x + player.width >= pipe.position.x && player.position.x <= pipe.position.x + pipe.width) {
player.velocity.y = 0;
jumpedOnce = false;
}
hitPlatform = true;
jumpedOnce = false;
}
if (player.position.y + player.height <= pipe.position.y && player.position.y + player.height + player.velocity.y >= pipe.position.y && player.position.x + player.width >= pipe.position.x && player.position.x <= pipe.position.x + pipe.width) {
player.velocity.y = 0;
jumpedOnce = false;
}