There is probably a smarter way to do it but you could check if the player is overlapping at offset the red wall to the right and left. Like player is overlapping platform hitbox at offset x 15 y 0 or player is overlapping platform hitbox at offset x -15 y 0. Also you might want to make the player with the platform ability and the animations on two separate sprites and just pin the animation one to the player one. This would make it easier to deal with Collison boxes.