06-22-2018, 06:46 AM
Hi Daniel!
You're on the right way. There's no built-in mechanism to do sprite vs playfield collision detection, but there are some helper functions to aid you. The usual way is to define some "hot points" in your sprite, usually spaced by the same amount of pixels than the tileset you're checking collision. Then test the suitable points, depending on the motion direction, in which tiles they fall and check their types. This is what SuperMarioClone and PythonPlatformer sister projects do.
You're on the right way. There's no built-in mechanism to do sprite vs playfield collision detection, but there are some helper functions to aid you. The usual way is to define some "hot points" in your sprite, usually spaced by the same amount of pixels than the tileset you're checking collision. Then test the suitable points, depending on the motion direction, in which tiles they fall and check their types. This is what SuperMarioClone and PythonPlatformer sister projects do.