10 REM - Wandering PUMPKIN1.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 PUMPKIN
60 REM Set initial colors for the PUMPKIN parts
70 OC = 17 : REM Initial outer color (Orange for pumpkin)
80 MC = 18 : REM Initial middle color (Darker orange for shading)
90 CC = 19 : REM Initial center color (Black for face features)
100 FOR STEPS = 1 TO 1000 : REM Loop to keep PUMPKIN wandering
110 GOSUB 4000 : REM Move the pumpkin to a new random position
120 GOSUB 2000 : REM Draw the PUMPKIN with changing colors
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 "Z"
1040 RETURN

2000 REM PUMPKIN Drawing Routine
2010 DZOP "C",OC : REM Set color for outer ellipse
2020 GOSUB 2100 : REM Draw outer pumpkin shape
2030 DZOP "C",MC : REM Set color for middle part
2040 GOSUB 2200 : REM Draw middle ellipse (pumpkin shading)
2050 DZOP "C",CC : REM Set color for face features
2060 GOSUB 2400 : REM Draw jack-o-lantern face
2095 RETURN

2100 REM Draw Outer PUMPKIN Ellipse (Wider, more pumpkin-shaped)
2110 FOR T = 0 TO (2*PI) STEP .1
2120 X = XC + 80 * COS(T) : Y = YC + 50 * SIN(T)
2130 IF X >= 0 AND X <= 255 AND Y >= 0 AND Y <= 255 THEN DZOP "P", X,Y : DZOP "D"
2140 NEXT T
2150 RETURN

2200 REM Draw Middle PUMPKIN Ellipse (Smaller, shading inside pumpkin)
2210 FOR T = 0 TO (2*PI) STEP .1
2220 X = XC + 60 * COS(T) : Y = YC + 40 * 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

2300 REM Draw Center PUMPKIN Circle (Used for stem or other details)
2310 FOR T = 0 TO (2*PI) STEP .1
2320 X = XC + 20 * COS(T) : Y = YC + 20 * SIN(T)
2330 IF X >= 0 AND X <= 255 AND Y >= 0 AND Y <= 255 THEN DZOP "P", X,Y : DZOP "D"
2340 NEXT T
2350 RETURN

2400 REM Draw Jack-o-Lantern Face (Triangles for eyes and jagged mouth)
2410 REM Draw Left Eye
2420 DZOP "P", XC-20,YC+10 : DZOP "L",XC-10,YC+30 : DZOP "L",XC-30,YC+30 : DZOP "L",XC-20,YC+10
2430 REM Draw Right Eye
2440 DZOP "P", XC+20,YC+10 : DZOP "L",XC+10,YC+30 : DZOP "L",XC+30,YC+30 : DZOP "L",XC+20,YC+10
2450 REM Draw Jagged Mouth
2460 DZOP "P", XC-30,YC-10 : DZOP "L",XC-20,YC-20 : DZOP "L",XC-10,YC-10 : DZOP "L",XC+10,YC-20 : DZOP "L",XC+20,YC-10 : DZOP "L",XC+30,YC-20
2495 RETURN

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

4000 REM Move the PUMPKIN 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 PUMPKIN Color Scheme
5010 OC = OC + 1 : IF OC > 23 THEN OC = 17
5020 MC = MC + 1 : IF MC > 23 THEN MC = 17
5030 CC = CC + 1 : IF CC > 23 THEN CC = 17
5040 RETURN

9999 REM End of Program
10000 GOTO 10
