objects/oEnd/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.
oEnd's step event, 33 lines of GML.
timer += 1;if (keyboard_check_pressed(vk_enter) or keyboard_check_pressed(vk_escape) or checkAttackPressed() or checkStartPressed()){ if (timer > 50) { if (gamepad.attackPressed) gamepad.attackPressed = false; if (gamepad.startPressed) gamepad.startPressed = false; global.gameStart = false; room_goto(rEnd3); }}// shake the screenif (global.shake > 0){ //view_xview[0] = view_xview[0] + rand(0,3) - rand(0,3); //view_yview[0] = view_yview[0] + rand(0,3) - rand(0,3); //if (view_yview[0] > 16) view_yview[0] = 16 - rand(0,8); //if (view_yview[0] < 0) view_yview[0] = 0 + rand(0,8); if (shakeToggle) view_yview[0] = view_yview[0] + rand(1,8); else view_yview[0] = 0; shakeToggle = not shakeToggle; global.shake -= 1;}else{ view_yview[0] = 0;}if (view_xview[0] < room_width - 320) view_xview[0] += 1;