The program detects floor by comparing the colours on the background below Baba's feet, but the detection is quite finicky to save processing power.