create a new function for player that is called bool MapObjInterscetsPlayer(MapObject x)
this will create two rects, one from the x.getrect() and the other created from player.xmap, ymap, hitboxwidth and hitboxheight.
It will then check to see if they intersect here, are return a bool.
this is just one idea, maybe model collision after the ground and the player?
create a new function for player that is called bool MapObjInterscetsPlayer(MapObject x)
this will create two rects, one from the x.getrect() and the other created from player.xmap, ymap, hitboxwidth and hitboxheight. It will then check to see if they intersect here, are return a bool.
this is just one idea, maybe model collision after the ground and the player?