SpelunkyFan wiki

objects/oEndCustom/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.

oEndCustom's draw event, 70 lines of GML.

if (drawStatus > 0){    draw_set_font(global.myFont);    draw_set_color(c_yellow);    draw_text(64, 32, "YOU MADE IT!");}if (drawStatus > 1){    draw_set_font(global.myFontSmall);    draw_set_color(c_yellow);    draw_text(64, 64, "FINAL SCORE:");}if (drawStatus > 2){    draw_set_font(global.myFont);    draw_set_color(c_white);    draw_text(64, 72, "$" + string(moneyCount));}if (drawStatus > 4){    s = global.time;    s = floor(s / 1000);    m = 0;    while (s > 59)    {        s -= 60;        m += 1;    }    draw_set_font(global.myFontSmall);    draw_set_color(c_yellow);    draw_text(64, 96, "TIME: ");    draw_set_color(c_white);    if (s < 10) draw_text(96+24, 96, string(m) + ":0" + string(s));    else draw_text(96+24, 96, string(m) + ":" + string(s));}if (drawStatus > 5){    draw_set_font(global.myFontSmall);    draw_set_color(c_yellow);    draw_text(64, 96+8, "KILLS: ");    draw_set_color(c_white);    draw_text(96+24, 96+8, global.kills);}if (drawStatus > 6){    draw_set_font(global.myFontSmall);    draw_set_color(c_yellow);    draw_text(64, 96+16, "SAVES: ");    draw_set_color(c_white);    draw_text(96+24, 96+16, global.damsels);}if (fadeOut){    draw_set_color(c_black);    draw_set_alpha(fadeLevel);    draw_rectangle(0, 0, 320, 240, false);    draw_set_alpha(1);}if (drawStatus == 8){    draw_set_font(global.myFontSmall);    draw_set_color(c_white);    strLen = string_length("YOU SHALL BE REMEMBERED AS A HERO.")*8;    n = 320 - strLen;    n = ceil(n / 2);    draw_text(n, 116, string("YOU SHALL BE REMEMBERED AS A HERO."));}