objects/oTemp/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.
oTemp's step event, 45 lines of GML.
// ==== action 0: lib 1 id 603: code ====if (fired == 0 and abs(oPlayer1.y-y-8) < 8 and oPlayer1.x < x+8 and point_distance(x+8, y+8, oPlayer1.x, oPlayer1.y) < 128 and (abs(oPlayer1.xVel) > 0 or abs(oPlayer1.yVel) > 0)){ arrow = instance_create(x-16, y+4, oArrow); arrow.xVel = -8; fired += 1; sound_play(sndArrowTrap);}obj = instance_nearest(x, y, oEnemy);if (obj) {if (fired == 0 and abs(obj.y-y-8) < 8 and obj.x < x and point_distance(x, y, obj.x, obj.y) < 128 and (abs(obj.xVel) > 0 or abs(obj.yVel) > 0)){ arrow = instance_create(x-16, y+4, oArrow); arrow.xVel = -8; fired += 1; sound_play(sndArrowTrap);}}obj = instance_nearest(x, y, oMoveableSolid);if (obj) {if (fired == 0 and abs(obj.y-y-8) < 8 and obj.x < x and point_distance(x, y, obj.x, obj.y) < 128){ arrow = instance_create(x-16, y+4, oArrow); arrow.xVel = -8; fired += 1; sound_play(sndArrowTrap);}}obj = instance_nearest(x-16, y, oItem);if (obj) {if (fired == 0 and abs(obj.y-y-8) < 8 and obj.x < x+8 and point_distance(x+8, y+8, obj.x, obj.y) < 128 and (abs(obj.xVel) > 0 or abs(obj.yVel) > 0)){ arrow = instance_create(x-16, y+4, oArrow); arrow.xVel = -8; fired += 1; sound_play(sndArrowTrap);}}// ==== action 1: lib 1 id 603: code ====x = ceil(x);y = ceil(y);