DIRECTORY BasicTime, DefaultRemoteNames, Graphics, GraphicsOps, NewerBottom, Process, Random, Rope; EyeHack: CEDAR PROGRAM IMPORTS BasicTime, DefaultRemoteNames, Graphics, GraphicsOps, NewerBottom, Process, Random, Rope = { ROPE: TYPE = Rope.ROPE; loaded: BOOL _ FALSE; images: ARRAY ImageIndex OF Image; ImageIndex: TYPE = NAT [0 .. ImageCount); ImageCount: NAT = 4; Image: TYPE = RECORD [ ir: Graphics.ImageRef _ NIL, yFudge: INTEGER _ 0]; imageBox: IntBox _ [-50, -32, 50, 100-32]; IntBox: TYPE = RECORD [xmin, ymin, xmax, ymax: INT]; imageRadius: REAL _ 31; screenBitmap: GraphicsOps.BitmapRef _ GraphicsOps.ScreenBitmap[]; quitProb: REAL _ 0.01; idleMin: INT _ 360; idleMax: INT _ 3600; posMin: INT _ 300; posMax: INT _ 1000; posMsecs: INT; Hack: PROC = { cx, cy: INTEGER; circle: Graphics.Path; first: BOOL _ TRUE; myC: Graphics.Context _ Graphics.NewContext[]; EnsureLoaded[]; cx _ Random.Choose[1 - imageBox.xmin, screenBitmap.width-1 - imageBox.xmax]; cy _ Random.Choose[1 - imageBox.ymin, screenBitmap.height-1 - imageBox.ymax]; circle _ NewerBottom.Circle[cx, cy, imageRadius]; Graphics.ClipArea[myC, circle]; DO i: ImageIndex _ Random.Choose[0, ImageCount-1]; Graphics.SetCP[myC, cx + imageBox.xmin, cy + imageBox.ymin + images[i].yFudge]; Graphics.DrawImage[myC, images[i].ir]; IF first THEN NewerBottom.DoXFormer[[clipPath: circle, clipByPath: TRUE], FALSE]; first _ FALSE; posMsecs _ Random.Choose[posMin, posMax]; Process.Pause[Process.MsecToTicks[posMsecs]]; IF Random.Choose[1, 1000]/1000.0 <= quitProb THEN EXIT; ENDLOOP; NewerBottom.Vanillify[]; }; idleSecs: INT; enabled: BOOL _ TRUE; BackHack: PROC = { DO now: BasicTime.Unpacked _ BasicTime.Unpack[BasicTime.Now[]]; IF now.month # April OR now.day # 1 THEN EXIT; idleSecs _ Random.Choose[idleMin, idleMax]; Process.Pause[Process.SecondsToTicks[idleSecs]]; IF NOT enabled THEN EXIT; Hack[]; ENDLOOP; }; prefix: ROPE _ Rope.Cat[ DefaultRemoteNames.Get[].systemHost, "MazeWar>Eyeball"]; postfix: ROPE _ ".AIS"; EnsureLoaded: PROC = { Load: PROC [index: ImageIndex, side: ROPE, yFudge: INTEGER] = { images[index] _ [ ir: GraphicsOps.NewAisImage[prefix.Cat[side, postfix]], yFudge: yFudge]; }; IF loaded THEN RETURN; Load[0, "Front", 0]; Load[1, "Left", 0]; Load[2, "Right", -1]; Load[3, "Back", 0]; loaded _ TRUE; }; Forkit: PROC = TRUSTED {Process.Detach[FORK BackHack[]]}; Forkit[]; }. NEyeHack.Mesa Last Edited by: Spreitzer, March 31, 1985 10:06:53 pm PST Κ– "cedar" style˜Icodešœ ™ J™9K˜KšΟk œZ˜cK˜šΠbxœœ˜KšœY˜`K˜Kšœ˜K˜Kšœœœ˜K˜Kšœœœ˜Kšœœ œ˜"Kšœ œœ˜)Kšœ œ˜šœœœ˜Kšœœ˜Kšœœ˜—K˜K˜*Kšœœœœ˜4Kšœ œ˜K˜AKšœ œ˜Kšœ œ˜Kšœ œ˜Kšœœ˜Kšœœ˜K˜Kšœ œ˜K˜šΟnœœ˜Kšœœ˜K˜Kšœœœ˜K˜.K˜K˜LK˜MK˜1K˜š˜K˜/K˜OK˜&Kšœœ6œœ˜QKšœœ˜Kšœ)˜)Kšœ-˜-Kšœ+œœ˜7Kšœ˜—K˜K˜—K˜Kšœ œ˜Kšœ œœ˜K˜šŸœœ˜š˜K˜