objects/oSlider1/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.
oSlider1's step event, 17 lines of GML.
if (mouse_check_button(mb_left) and focus){ x = mouse_x-4; if (x > 144) x = 144; if (x < 8) x = 8; y = 160; global.musicVol = floor(x / 8); SS_SetSoundVol(global.musCave, 2000 + 8000 * (global.musicVol/18));}else{ focus = false; move_snap(8, 8); y = 160; global.musicVol = x / 8; stopAllMusic();}