objects/oThinIce/step.gml
From spelunky.gmk, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC, shown whole under the Spelunky User License v1.1b. Extracted by spelunky.ai's tools, an unofficial fan project, one file per script or event; the // ==== lines are the extractor's, naming each action of the event. Some scripts are others' work that Derek Yu credits in the source's readme.txt: Martin Piecyk's platform engine, ChevyRay's view scaling scripts and tsg1zzn's Super Sound System.
oThinIce's step event, 13 lines of GML.
if (collision_rectangle(x, y-1, x+16, y+1, oPlayer1, 0, 0)){ thickness -= 2; if (rand(1,100) == 1) instance_create(x+rand(0,16), y+9, oDrip);}if (thickness > 50) sprite_index = sThinIce1;else if (thickness > 40) sprite_index = sThinIce2;else if (thickness > 30) sprite_index = sThinIce3;else if (thickness > 20) sprite_index = sThinIce4;else if (thickness > 10) sprite_index = sThinIce5;else if (thickness > 0) sprite_index = sThinIce6;else instance_destroy();