SpelunkyFan wiki

objects/oTitle/draw.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.

oTitle's draw event, 29 lines of GML.

if (instance_exists(oFlare) and needDark){    dist = 160 - oFlare.y;    if (dist < 0) dist = 0;    darkness = dist / 160;    if (darkness == 0) needDark = false;}draw_set_alpha(1);/*draw_set_font(global.myFontSmall);draw_set_color(c_yellow);draw_text(320+96, 96, "V1.1 (C)2009");*/if (instance_exists(oPlayer1)){    player = instance_nearest(0, 0, oPlayer1);    if (player.x < 256 and view_xview[0] <= 1)    {        draw_set_font(global.myFontSmall);        draw_set_color(c_white);        strLen = string_length("WELCOME TO THE SHORTCUT HOUSE!")*8;        n = 320 - strLen;        n = ceil(n / 2);        draw_text(n, 224, string("WELCOME TO THE SHORTCUT HOUSE!"));    }}