10 REM - Wandering Oval Face with X Eyes DEADEYES.BAS.txt

20 GOSUB 1000 : REM Clear the Screen
30 PI = 3.14159
40 DZOP "C",1 : REM Color mode [Range = 16-23]
50 XC = 128 : YC = 128 : REM Initial center of the Oval

60 REM Set initial colors for the Oval and eyes
70 IC = 18 : REM Initial inner color
80 EC = 23 : REM Color for "X" eyes (white)

100 FOR STEPS = 1 TO 1000 : REM Loop to keep the face wandering
110 GOSUB 4000 : REM Move the face to a new random position
120 GOSUB 2000 : REM Draw the Oval face and eyes
130 GOSUB 3000 : REM Pause between moves
140 GOSUB 5000 : REM Update the color scheme for the next iteration
150 GOSUB 1000 : REM Clear the screen for the next position
160 NEXT STEPS

999 GOTO 10 : REM Loop back to the beginning for continuous run

1000 REM Clear the Screen Routine
1010 DZOP "C",16 : REM Clear screen with black
1020 DZOP "P",0,0
1030 DZOP "R",255,255
1040 RETURN

2000 REM Oval Face Drawing Routine
2030 DZOP "C",IC : REM Set color for inner oval
2040 GOSUB 2200 : REM Draw inner oval

2050 DZOP "C",EC : REM Set color for eyes ("X")
2060 GOSUB 2400 : REM Draw eyes

2095 RETURN

2200 REM Draw Inner Oval (Smaller Horizontal Ellipse)
2210 FOR T = 0 TO (2*PI) STEP 0.1
2220 X = XC + 50 * COS(T) : Y = YC + 25 * SIN(T)
2230 IF X >= 0 AND X <= 255 AND Y >= 0 AND Y <= 255 THEN DZOP "P", X,Y : DZOP "D"
2240 NEXT T
2250 RETURN

2400 REM Draw Eyes ("X" shapes with two slants for each eye)
2410 REM Left Eye "X"
2411 DZOP "P", XC-20, YC+10 : DZOP "L", XC-15, YC+5 : DZOP "L", XC-25, YC+15 : REM First slant
2412 DZOP "P", XC-20, YC+10 : DZOP "L", XC-15, YC+15 : DZOP "L", XC-25, YC+5 : REM Second slant (cross)

2420 REM Right Eye "X"
2421 DZOP "P", XC+20, YC+10 : DZOP "L", XC+15, YC+5 : DZOP "L", XC+25, YC+15 : REM First slant
2422 DZOP "P", XC+20, YC+10 : DZOP "L", XC+15, YC+15 : DZOP "L", XC+25, YC+5 : REM Second slant (cross)

2430 RETURN

3000 REM Pause Routine
3010 FOR PAUSE = 1 TO 300 : NEXT PAUSE : REM Short pause
3020 RETURN

4000 REM Move the Oval Face to a new random position
4010 XC = INT(RND(1)*160) + 48 : YC = INT(RND(1)*160) + 48 : REM Random position within screen bounds
4020 RETURN

5000 REM Update the Oval Face Color Scheme
5010 IC = IC + 1 : IF IC > 23 THEN IC = 17
5040 RETURN

9999 REM End of Program
10000 GOTO 10
