10 REM - Hippy Flower FLPOWER1.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 Eye
60 REM Set initial colors for the CBS Eye parts
70 OC = 17 : REM Initial outer color
80 MC = 18 : REM Initial middle color
90 CC = 19 : REM Initial center color
100 FOR STEPS = 1 TO 1000 : REM Loop to keep CBS eye wandering
110 GOSUB 4000 : REM Move the eye to a new random position
120 GOSUB 2000 : REM Draw the CBS Eye 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 Hippy Flower Drawing Routine
2010 DZOP "C",OC : REM Set color for flower petals
2020 GOSUB 2100 : REM Draw flower petals
2030 DZOP "C",MC : REM Set color for inner part
2040 GOSUB 2200 : REM Draw inner flower circle
2050 DZOP "C",CC : REM Set color for flower center
2060 GOSUB 2300 : REM Draw flower center
2095 RETURN

2100 REM Draw Petals
2110 FOR T = 0 TO (2*PI) STEP .4 : REM Create 8 petals around the center
2120 PX = XC + 60 * COS(T) : PY = YC + 60 * SIN(T)
2130 GOSUB 2400 : REM Draw each petal at calculated position
2140 NEXT T
2150 RETURN

2200 REM Draw Inner Circle (Smaller)
2210 FOR T = 0 TO (2*PI) STEP .1
2220 X = XC + 40 * 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 Flower Circle
2310 FOR T = 0 TO (2*PI) STEP .1
2320 X = XC + 15 * COS(T) : Y = YC + 15 * 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 Individual Petal
2410 FOR P = 0 TO (2*PI) STEP .1
2420 X = PX + 20 * COS(P) : Y = PY + 10 * SIN(P) : REM Petal shape
2430 IF X >= 0 AND X <= 255 AND Y >= 0 AND Y <= 255 THEN DZOP "P", X,Y : DZOP "D"
2440 NEXT P
2450 RETURN

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

4000 REM Move the CBS Eye 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 CBS Eye 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
