Rewritten collision detection (slopes not supported yet)