Move the sprite 1 pixel down, check for overlap with ground then move the sprite back up.
every tick:
----Sprite| set isInAir to true
----Sprite| set Y: y+1
Sprite| is overlapping ground:
----Sprite| set isInAir to false
every tick:
----Sprite| set Y: y-1