Jump to content

LINES demo for the Tandy Color Computer 2

Posted by hloberg, in programming, coco2 31 January 2019 · 90 views

color computer coco2 trs-80 basic demo programming

Here is simple little demo I did for the Atari Action! tutorial on the Tandy Color Computer 2. It's written in BASIC. I choose the green background but maybe the 'buff' background might be better?
Anyway, the Youtube video.
and the code:
15 PMODE 1,1
20 SCREEN 1,0
35 COLOR 3,5
40 X1=9:Y1=12:X2=40:Y2=30:Z=2
50 A=8:B=8:C=8:D=8
100 COLOR Z,5
110 LINE (X1,Y1)-(X2,Y2),PSET
124 IF A>1 AND RND(0)<0.1 THEN A=INT(RND(0)*4)+2
127 IF D>1 AND RND(0)<0.1 THEN D=INT(RND(0)*4)+2
130 X1=X1+A:Y1=Y1-B
140 X2=X2-C:Y2=Y2+D
150 IF Y1<9 OR Y1>188 THEN B=-B
155 IF Y2<9 OR Y2>188 THEN D=-D
160 IF X1<9 OR X1>254 THEN A=-A
165 IF X2<9 OR X2>254 THEN C=-C
190 IF RND(0)<0.05 THEN Z=INT(RND(0)*3)+2
200 T=T+1:IF T>100 THEN T=0:PCLS
1200 GOTO 100

I spent a bunch of time programming the CoCo (original upgraded to 64K RAM), both in Extended Color Basic and EDASM.  I programmed similar demos as well (including one in ASM using my own recursive line drawing algorithm).


Ahh.. the memories...

  • Report