MULTI-COLOR-LINES-LOW-RESOLUTION-C128 -------------------------------------------------------------------------------------------------- TOOL: BASIC 7.0 {Commodore C128} Language: BASIC 7.0 Extra: None Author: Misel Zivanovic Note: (C) 8th OCT 2024 - www.lived.ch, mzretro.ch Information: None --------------------------------------------------------------------------------------------------- First thing first: This will also run on naked 1 MHz Commodore C128! I was actually surprised how well it performed. Thought it's not going to be wow!, but it then was { we are talking BASIC, 1MHz CPU! } FD is defining a number of line groups { def = 1 but you can smash 4 if you want! More is making no sense and it's ugly } { cs = color selection mode {1 - 3, multi color } { colors definition is line 130 } In case you want to see this really flying, then switch to WARP mode in VICE and enjoy the show! list 100 color 0,7:color 4,7: color 5,8 105 rem background / screen / text color 110 graphic 3,1: rem multicolor 160x200 115 dim x1(5),y1(5),x2(5),y2(5) 120 dim s1(5),s2(5),s3(5),s4(5) 125 fd=1 130 color 1,8:color 2,9:color 3,10 135 : 140 fora=1tofd:rem can take a bit (fd!) 145 x1=int(rnd(ti)*160) 150 x2(a)=int(rnd(ti)*160) 155 y1(a)=int(rnd(ti)*200) 160 y2(a)=int(rnd(ti)*200) 165 : 170 s1(a)=int(rnd(ti)*3)+1 175 s2(a)=int(rnd(ti)*3)+1 180 s3(a)=int(rnd(ti)*3)+1 185 s4(a)=int(rnd(ti)*3)+1 190 next 195 : 200 rem go 205 for a=1 to fd 210 x1(a)=x1(a)+s1(a) 215 y1(a)=y1(a)+s2(a) 220 x2(a)=x2(a)+s3(a) 225 y2(a)=y2(a)+s4(a) 230 : 235 if x1(a)>159 then s1(a)=-s1(a) 240 if x1(a)<1 then s1(a)=abs(s1(a)) 245 if x2(a)>159 then s3(a)=-s3(a) 250 if x2(a)<1 then s3(a)=abs(s3(a)) 255 : 260 if y1(a)>199 then s2(a)=-s2(a) 265 if y1(a)<1 then s2(a)=abs(s2(a)) 270 if y2(a)>199 then s4(a)=-s4(a) 275 if y2(a)<1 then s4(a)=abs(s4(a)) 280 : 285 cs=int(rnd(ti)*3)+10 305 : 310 draw cs,x1(a),y1(a) to x2(a),y2(a) 315 next 320 goto 200