objects/oCursObj/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.
oCursObj's step event, 11 lines of GML.
if (mouse_x > view_xview[0] and mouse_x < view_xview[0]+320 and mouse_y > view_yview[0] and mouse_y < view_yview[0]+240){ x = mouse_x-8; y = mouse_y-8; move_snap(16, 16); if (x < 0) x = 0; if (x > room_width-16) x = room_width-16; if (y < 0) y = 0; if (y > room_height-16) y = room_height-16;}