▲ 2 r/sfml
Checking if the player is colliding with any object on the screen
This isn't really a question about SFML but about game development in general. I'm making a simple platform game in SFML and I need to check if the player is colliding with any of the platforms on the screen so I can determine wether the player can jump, move right, move left or allow gravity. My first instinct is to have a for loop that runs through all the platforms on the screen and check if the player is colliding with it and check in which direction the platform is in and not allow the player to go in that direction, but I'm wondering if there is a better way to do that.
u/EpsilonDeltaGuy — 7 days ago