objects/oOlmec/alarm_1.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.
oOlmec's alarm 1 event, 27 lines of GML.
sprite_index = sOlmecStart2;for (i = 0; i < 6; i += 1){ debris = instance_create(x+32+rand(0,32), y+rand(0,32), oOlmecDebris); debris.xVel = rand(1,4); debris.yVel = -rand(1,3);}playSound(global.sndThump);with oHawkmanWorship{ obj = instance_create(x, y, oHawkman); with obj { status = 98; hp = 1; xVel = -3; yVel = -5; counter = 300; } instance_destroy();}with oCavemanWorship{ image_index = 0; image_speed = 0;}alarm[2] = 50;