SpelunkyFan wiki

objects/oTarget/collision_oArrow.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.

oTarget's collision oArrow event, 22 lines of GML.

other.xVel = 0;other.yVel = 0;if (not dying){    dying = true;    n = 0;    if (other.y >= y-2 and other.y <= y+2)    {        n = 5;        playSound(global.sndCoin);    }    else if (other.y >= y-6 and other.y <= y-3) n = 3;    else if (other.y >= y+3 and other.y <= y+6) n = 3;    else if (other.y >= y-10 and other.y <= y-7) n = 2;    else if (other.y >= y+7 and other.y <= y+10) n = 2;    else n = 1;    //if (hard) n *= 2;    oMoonRoom.baskets += n;    playSound(global.sndHit);}if (life <= 2) with other { instance_destroy(); }