As said above, checking player velocity and changing collidebits works. I figured I would share some code I made for an old attempt at a platformer that worked well for this.
This code obviously won't compile unless the player type is set up correctly 'n that
setSpriteCollideBit(player.id, 2, 1)
global platformCount as integer
platformCount = 0
for n = 0 to 1
platform[n] = createSprite(0)
setSpriteSize(platform[n], 24, 4)
setSpritePositionByOffset(platform[n], 0, -200 + (24*n))
setSpriteColor(platform[n], 174, 141, 81, 255)
setSpriteShapeBox(platform[n], -12, -3, 12, -1, 0)
setSpritePhysicsOn(platform[n], 3)
setSpriteGroup(platform[n], 1)
setSpriteCategoryBit(platform[n], 1, 0)
setSpriteCategoryBit(platform[n], 2, 1)
setSpriteShader(platform[n], shader)
next n
function platformTest()
if platformCount > 0
for n = 0 to platFormCount
platformDelta = getSpriteY(platform[n]) - player.y
platformTouch = platformFootLeft + platformFootRight
drop = control.down + control.A
if platformTouch > 0 and player.velocityY > 0 and platformDelta >= 7 and drop < 2
//setSpriteCollideBit(platform[n], 1, 1)
setSpriteCollideBit(player.id, 2,1)
else
if drop = 2 then setSpritePositionByOffset(player.id, player.x, player.y+3)
//setSpriteCollideBit(platform[n], 1, 0)
setSpriteCollideBit(player.id, 2,0)
endIf
for nn = 0 to enemyCount
enBottom = getSpriteY(enemy[nn].id) + getSpriteHeight(enemy[nn].id)
if enemy[nn].velY < 0 and enBottom < getSpriteYByOffset(platform[n]) -4
setSpriteCollideBit(enemy[nn].id, 2, 0)
else
setSpriteCollideBit(enemy[nn].id, 2, 1)
endIf
next nn
next n
endIf // platfromcount > 0
endFunction
Just noticed that the platformCount integer isn't changed in the loop creating platforms in this code, which you would want
My hovercraft is full of eels