HANGMAN thread continues in GAMES.

Talk about your programs in progress. Discuss how to implement features, etc.
Forum rules
This section is for testing Commander X16 programs and programs related to the CX16 for other platforms (compilers, data conversion tools, etc.)

Feel free to post works in progress, test builds, prototypes, and tech demos.

Finished works go in the Downloads category. Don't forget to add a hashtag (#) and the version number your program was meant to run on. (ie: #R41).
User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

ANOTHER BODY PART !! Left ARM

Post by ahenry3068 »

3 body parts until I have to code actual Game Logic.

YES HE HAS 3 FINGERS. COULDN'T FIT 4 INTO THE RESOLUTION.
FINGERS ARE ONLY 1 PIXEL WIDE AS IT IS.

Current Code:

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416 
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
190 INPUT X$
200 SCREEN 0:END

2999 REM CIRCLE AND ELLIPSE SUBROUTINE
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .3/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC 
3300 NEXT I
3310 RETURN 

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07:
5040 FOR RA = 31 TO 1 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5050 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1  
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN 
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN 

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,16
7020 FRAME 190,196,284,209,16
7030 FRAME 275,21,285,207,16
7040 FRAME 276,22,284,205,16
7050 FRAME 67,20,285,30,16
7060 FRAME 68,21,284,29,16
7070 RECT  71,30,79,33,16
7080 RECT  191,197,283,207,83
7090 RECT  277,23,283,206,83
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38
8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE 

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000
9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9530 CX = 89:RA = 6:CC=$10
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9555 REM DRAW HIS NECK 
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK
9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000
9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 GOSUB 9950:REM THE PUPILS OF HIS EYES 
9710 CX = CX + 12:GOSUB 3000
9720 GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000  
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS 
9950 PSET CX,CY, 16:PSET CX -1,CY,16
9955 PSET CX,CY -1,16:PSET CX - 1, CY -1 ,16
9960 RETURN
REM END FACE 

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10 
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000 
10440 CHAR 57,106,$10,"P-1"
10600 RETURN 

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 1 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
12000 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

SOME OPTIMIZATIONS.

Post by ahenry3068 »

Mostly the same output drawing as the last time.
Made the routine to draw the sun much faster by mostly
filling in with RECT and only using my Circle routine for the
Outermost lines.

Also used RECT to fill in the pixel artifacts left by my imperfect FILL on the Ellipse
which is the Hanged Man's face.

There are also 2 new GOSUB's in the code that are currently unused.
Starting at line 4000 there is an attempt at implementing the Midpoint Circle Algorithm
rather than SIN/COS. This currently isn't working right for my purposes, but I left
it in for the time being. Also at 12000 there is a routine REM'ed for the other arm.
I renumbered all the lines but it's currently just a COPY/PASTE of the routine for
the Left arm I already drew. I need to get in and change a lot of the numbers.

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416 
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
190 INPUT X$
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM 
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC 
3300 NEXT I
3310 RETURN 

4000 REM MIDPOINT ALGORITHM
4010 IF XS>0 AND XS<1 THEN 4020
4015 XS=1
4020 IF YS>0 AND YS<1 THEN 4100
4025 YS=1
4100 T1=RA/64:XA=RA:YA=0
4140 IF FILL=1 THEN 4380
4130 PSET CX+(XA*XS),CY+(YA*YS),CC
4140 PSET CX+(XA*XS),CY-(YA*YS),CC
4160 PSET CX-(XA*XS),CY+(YA*YS),CC
4180 PSET CX-(XA*XS),CY-(YA*YS),CC
4200 PSET CX+(YA*XS),CY+(XA*YS),CC
4220 PSET CX+(YA*XS),CY-(XA*YS),CC
4240 PSET CX-(YA*XS),CY+(XA*YS),CC
4260 PSET CX-(YA*XS),CY-(XA*YS),CC
4270 GOTO 4400

4380 LINE CX+(XA*XS),CY+(YA*YS),CX-(XA*XS),CY+(YA*YS),CC
4385 LINE CX+(YA*XS),CY+(XA*YS),CX-(YA*XS),CY+(XA*YS),CC
4390 LINE CX+(XA*XS),CY-(YA*YS),CX-(XA*XS),CY-(YA*YS),CC
4395 LINE CX+(YA*XS),CY-(XA*YS),CX-(YA*XS),CY-(XA*YS),CC

4400 YA=YA+1
4410 T1=T1+YA
4420 T2=T1-XA
4440 IF T2 >= 0 THEN T1=T2:XA=XA-1
4460 IF XA>=YA THEN 4140
4600 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC

5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5050 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1  
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN 
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN 

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE 

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK 
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000

9672 RECT 62,54,85,73,CC

9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 GOSUB 9950:REM THE PUPILS OF HIS EYES 
9710 CX = CX + 12:GOSUB 3000
9720 GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000  
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS 
9950 PSET CX,CY, 16:PSET CX -1,CY,16
9955 PSET CX,CY -1,16:PSET CX - 1, CY -1 ,16
9956 PSET CX+4,CY,$25
9960 RETURN
REM END FACE 

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10 
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000 
10440 CHAR 57,106,$10,"P-1"
10600 RETURN 

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 116:CX = 92:
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
12095 GOSUB 3000
12096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
12100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
12105 FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115 NEXT RA
12116 RECT CX-1,CY-3,CX+1,CY-7,$08
12120 LINE 99,115,99,133,$10
12130 LINE 111,102,111,133,$10
12135 RECT 100,102,110,133,$08
12140 LINE 99,107,99,109,$08
12145 LINE 98,108,101,108,$08
12150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
12155 LINE 99,134,111,134,$10

12159 REM (THE LEFT HAND)
12160 LINE 101,134,101,143,$10
12165 LINE 101,143,103,143,$10
12166 LINE 102,142,102,139,$25

12170 LINE 103,144,103,140,$10
12175 LINE 103,145,105,145,$10
12176 LINE 104,144,104,139,$25

12180 LINE 105,146,105,140,$10
12185 LINE 105,146,107,146,$10
12186 LINE 106,145,106,139,$25

12190 LINE 107,146,107,140,$10
12195 LINE 107,145,109,145,$10
12196 LINE 108,144,108,139,$25

12200 LINE 109,145,109,134,$10
12205 RECT 102,139,108,135,$25
12210 RETURN
User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

BOTH ARMS DONE

Post by ahenry3068 »

Finished the Left Arm :)

Heres the code

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416 
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
190 INPUT X$
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM 
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC 
3300 NEXT I
3310 RETURN 

4000 REM MIDPOINT ALGORITHM
4010 IF XS>0 AND XS<1 THEN 4020
4015 XS=1
4020 IF YS>0 AND YS<1 THEN 4100
4025 YS=1
4100 T1=RA/64:XA=RA:YA=0
4140 IF FILL=1 THEN 4380
4130 PSET CX+(XA*XS),CY+(YA*YS),CC
4140 PSET CX+(XA*XS),CY-(YA*YS),CC
4160 PSET CX-(XA*XS),CY+(YA*YS),CC
4180 PSET CX-(XA*XS),CY-(YA*YS),CC
4200 PSET CX+(YA*XS),CY+(XA*YS),CC
4220 PSET CX+(YA*XS),CY-(XA*YS),CC
4240 PSET CX-(YA*XS),CY+(XA*YS),CC
4260 PSET CX-(YA*XS),CY-(XA*YS),CC
4270 GOTO 4400

4380 LINE CX+(XA*XS),CY+(YA*YS),CX-(XA*XS),CY+(YA*YS),CC
4385 LINE CX+(YA*XS),CY+(XA*YS),CX-(YA*XS),CY+(XA*YS),CC
4390 LINE CX+(XA*XS),CY-(YA*YS),CX-(XA*XS),CY-(YA*YS),CC
4395 LINE CX+(YA*XS),CY-(XA*YS),CX-(YA*XS),CY-(XA*YS),CC

4400 YA=YA+1
4410 T1=T1+YA
4420 T2=T1-XA
4440 IF T2 >= 0 THEN T1=T2:XA=XA-1
4460 IF XA>=YA THEN 4140
4600 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC


5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5050 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1  
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN 
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN 


7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE 

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK 
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000

9672 RECT 62,54,85,73,CC

9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 GOSUB 9950:REM THE PUPILS OF HIS EYES 
9710 CX = CX + 12:GOSUB 3000
9720 GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000  
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS 
9950 PSET CX,CY, 16:PSET CX -1,CY,16
9955 PSET CX,CY -1,16:PSET CX - 1, CY -1 ,16
9956 PSET CX+4,CY,$25
9960 RETURN
REM END FACE 

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10 
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000 
10440 CHAR 57,106,$10,"P-1"
10600 RETURN 

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.35:CX = 42:CY = 105:FILL=0
12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-3,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 35,102,35,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 36,102,45,133,$08
12136  LINE 35,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN
User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

NOW THE LEGS

Post by ahenry3068 »

I'm not so happy with how the foot looks at the moment
But its time to go to work so posting what I've got done.

Here's the code.

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
190 INPUT X$
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM MIDPOINT ALGORITHM
4010 IF XS>0 AND XS<1 THEN 4020
4015 XS=1
4020 IF YS>0 AND YS<1 THEN 4100
4025 YS=1
4100 T1=RA/64:XA=RA:YA=0
4140 IF FILL=1 THEN 4380
4130 PSET CX+(XA*XS),CY+(YA*YS),CC
4140 PSET CX+(XA*XS),CY-(YA*YS),CC
4160 PSET CX-(XA*XS),CY+(YA*YS),CC
4180 PSET CX-(XA*XS),CY-(YA*YS),CC
4200 PSET CX+(YA*XS),CY+(XA*YS),CC
4220 PSET CX+(YA*XS),CY-(XA*YS),CC
4240 PSET CX-(YA*XS),CY+(XA*YS),CC
4260 PSET CX-(YA*XS),CY-(XA*YS),CC
4270 GOTO 4400

4380 LINE CX+(XA*XS),CY+(YA*YS),CX-(XA*XS),CY+(YA*YS),CC
4385 LINE CX+(YA*XS),CY+(XA*YS),CX-(YA*XS),CY+(XA*YS),CC
4390 LINE CX+(XA*XS),CY-(YA*YS),CX-(XA*XS),CY-(YA*YS),CC
4395 LINE CX+(YA*XS),CY-(XA*YS),CX-(YA*XS),CY-(XA*YS),CC

4400 YA=YA+1
4410 T1=T1+YA
4420 T2=T1-XA
4440 IF T2 >= 0 THEN T1=T2:XA=XA-1
4460 IF XA>=YA THEN 4140
4600 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC


5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5050 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN


7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000

9672 RECT 62,54,85,73,CC

9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 GOSUB 9950:REM THE PUPILS OF HIS EYES
9710 CX = CX + 12:GOSUB 3000
9720 GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, 16:PSET CX -1,CY,16
9955 PSET CX,CY -1,16:PSET CX - 1, CY -1 ,16
9956 PSET CX+4,CY,$25
9960 RETURN
REM END FACE

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,191,$10
12520 LINE 55,145,53,191,$10
12525 LINE 53,192,70,192,$10
12530 RECT 56,145,69,191,$48
12535 LINE 55,157,55,191,$48
12540 LINE 54,180,54,191,$48

12555 LINE 57,144,71,144,$48
12560 RECT 69,142,71,154,$48
12565 RECT 72,142,73,153,$48
12570 LINE 63,143,68,143,$48
12575 PSET 70,155,$48

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=18:XS=.40:CC=$10:FILL=1
12581 CX=62:CY=207
12585 GOSUB 3000:RA=RA-1:GOSUB 3000
12590 XS=.38:CY=204:CC=$1D:RA=11:GOSUB 3000
12595 LINE 57,192,57,202,$10
12600 LINE 66,192,66,202,$10
12605 RECT 58,193,65,197,$1D

12900 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

THE MAN IS HUNG !!! :)..

Post by ahenry3068 »

I have the complete Hangman all drawn....... :) :)..

I have a couple more things I want to tweek on the Background Scene before I move
on to Game Code. But the Game code is going to be starting soon. I expect it will
take much less time to do than this spaghetti Graphics code I've been plodding through.

I have a plan to release this in 2 stages. The first version is going to be Head to Head only(2 player).
Each player will enter a Word and (optional) clue for the other player. In the process
it will write these to a "HANGMAN.DAT" file. I plan on setting up a unique E-mail
for people to send me their "HANGMAN.DAT" files. I will consolidate them and build
a BIG .DAT file to include with the 2nd Version which will incorporate 1 player against Computer.

I haven't set up the E-mail yet. When I do it will be displayed in a Message in the first version of
the Game.

HERES THE CODE:
COMPLETE HANGED MAN :) :) :) :) :)

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
120 GOSUB 12620 : REM THE LEFT LEG
190 INPUT X$
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM MIDPOINT ALGORITHM
4010 IF XS>0 AND XS<1 THEN 4020
4015 XS=1
4020 IF YS>0 AND YS<1 THEN 4100
4025 YS=1
4100 T1=RA/64:XA=RA:YA=0
4140 IF FILL=1 THEN 4380
4130 PSET CX+(XA*XS),CY+(YA*YS),CC
4140 PSET CX+(XA*XS),CY-(YA*YS),CC
4160 PSET CX-(XA*XS),CY+(YA*YS),CC
4180 PSET CX-(XA*XS),CY-(YA*YS),CC
4200 PSET CX+(YA*XS),CY+(XA*YS),CC
4220 PSET CX+(YA*XS),CY-(XA*YS),CC
4240 PSET CX-(YA*XS),CY+(XA*YS),CC
4260 PSET CX-(YA*XS),CY-(XA*YS),CC
4270 GOTO 4400

4380 LINE CX+(XA*XS),CY+(YA*YS),CX-(XA*XS),CY+(YA*YS),CC
4385 LINE CX+(YA*XS),CY+(XA*YS),CX-(YA*XS),CY+(XA*YS),CC
4390 LINE CX+(XA*XS),CY-(YA*YS),CX-(XA*XS),CY-(YA*YS),CC
4395 LINE CX+(YA*XS),CY-(XA*YS),CX-(YA*XS),CY-(XA*YS),CC

4400 YA=YA+1
4410 T1=T1+YA
4420 T2=T1-XA
4440 IF T2 >= 0 THEN T1=T2:XA=XA-1
4460 IF XA>=YA THEN 4140
4600 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC


5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5050 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000

9672 RECT 62,54,85,73,CC

9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 GOSUB 9950:REM THE PUPILS OF HIS EYES
9710 CX = CX + 12:GOSUB 3000
9720 GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, 16:PSET CX -1,CY,16
9955 PSET CX,CY -1,16:PSET CX - 1, CY -1 ,16
9956 PSET CX+4,CY,$25
9960 RETURN
REM END FACE

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,192,$10
12520 LINE 55,145,53,192,$10
12525 LINE 53,193,70,193,$10
12530 RECT 56,145,69,192,$46
12535 LINE 55,157,55,192,$46
12540 LINE 54,181,54,192,$46

12555 LINE 57,144,71,144,$46
12560 RECT 69,142,71,154,$46
12565 RECT 72,142,73,153,$46
12570 LINE 63,143,68,143,$46
12575 PSET 70,155,$46

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1:CX=62:CY=208
12585 GOSUB 3000:RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12590 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12591 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12595 LINE 57,193,57,202,$10
12600 LINE 66,193,66,202,$10
12605 RECT 58,194,65,200,$1C
12610 RETURN

12619 REM LEFT LEG
12620 Q1=0:Q2=1:Q3=0:Q4=0
12625 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12630 GOSUB 3000
12635 LINE 77,157,77,192,$10
12640 LINE 90,145,92,192,$10
12645 LINE 77,193,92,193,$10
12650 RECT 78,145,89,192,$46
12655 LINE 90,157,90,192,$46
12660 LINE 91,181,91,192,$46

12665 LINE 74,144,88,144,$46
12670 RECT 76,143,79,154,$46
12675 RECT 74,142,76,153,$46
12680 LINE 74,143,82,143,$46
12685 LINE 77,154,77,156,$46

12689 REM THE FOOT
12690 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1
12695 CX=85:CY=208
12700 GOSUB 3000
12705 RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12710 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12715 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12720 LINE 80,193,80,202,$10
12725 LINE 89,193,89,202,$10
12730 RECT 81,194,88,200,$1C
12740 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

ADDED "DEAD" FACE.

Post by ahenry3068 »

Added in a "DEAD" Hangman's Face. To see it hit any Key after the Hanged Man is Drawn.
Not sure if this is the final look I'm going with...

Also tweaking the background scenery a little.

I'm calling it an early night to night. Going to be on here tomorrow hitting Refresh on Texelec every 10 secs.

Heres the newest code

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
120 GOSUB 12620 : REM THE LEFT LEG
190 GOSUB 35000 : REM WAIT FOR KEY
195 GOSUB 4000:GOSUB 35000
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM DEADFACE
4005 RA = 20
4010 CX = 74:CY = 63
4015 RA = RA -1
4020 RA = RA -1:RA = RA -1:XSQUISH=.8:YS=0
4030 RA = 17 :CC = $D2:FILL=1:CY = CY + 1:GOSUB 3000
4035 RECT 62,54,85,73,CC
4040 XS = 1:YS = XS
4045 CY = CY - 6:CX = CX - 6:RA=4:CC = $33:GOSUB 3000
4050 GOSUB 9950:REM THE PUPILS OF HIS EYES
4055 CX = CX + 12:GOSUB 3000
4060 GOSUB 9950:CX = 74:CY = 63
4065 LINE CX-1,CY, CX - 2, CY + 6, $10
4070 LINE CX+1,CY, CX + 2, CY + 6, $10
4075 LINE CX,CY,CX -1, CY + 6, $23
4080 LINE CX,CY,CX + 1, CY + 6, $23
4085 LINE CX,CY+3,CX,CY+6,$22
4090 Q3=0:Q4=0:CC=$3B:CY = CY + 13:YS=.35:RA=6:FILL=0
4095 GOSUB 3000
4100 CY = CY + 1:CC=$31:GOSUB 3000
4105 CY = CY + 1:CC=$3B:GOSUB 3000
4110 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
4200 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC
5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5046 REM BRUTE FORCE, RAYS FROM THE SUN...
5050 LINE 2,36,2,42,$07:LINE 6,36,6,43,$07
5051 LINE 9,36,10,42,$07:LINE 13,36,15,41,$07
5052 LINE 15,33,18,40,$07:LINE 18,33,21,39,$07
5053 LINE 20,31,24,38,$07:LINE 22,29,27,37,$07
5054 LINE 24,27,29,35,$07:LINE 27,25,32,32,$07
5055 LINE 30,23,35,29,$07:LINE 32,21,37,26,$07
5056 LINE 33,19,39,23,$07:LINE 35,17,41,20,$07
5057 LINE 36,15,42,17,$07:LINE 36,13,43,14,$07
5058 LINE 37,11,44,11,$07:LINE 37,8,44,8,$07
5060 LINE 37,5,45,5,$07:LINE 37,2,44,2,$07

5095 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, 5 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5180 TC = 104:GOSUB 6000:REM DRAW GRASS STUFF
5190 TC = 106:GOSUB 6000
5200 TC = 133:GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 10:REM RANDOM GRASS
6110     X1 = INT(RND(1)*XLIMIT)
6120     Y1 = INT(RND(1)*YLIMIT) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*XLIMIT) + 15:IF X2 = X1 OR X2 > XLIMIT THEN GOTO 6130
6140     Y2 = INT(RND(1)*YLIMIT) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 105 OR X1 - X2 > 105 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 12 THEN GOTO 6110
6150     LINE X1,Y1,X2,Y2, TC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6180 NEXT I
6190 RETURN

6500 RETURN:B1 = INT(RND(1)* XLIMIT/2)+1
6510 B2 = INT(RND(1)* XLIMIT/3)+1
6520 B3 = INT(RND(1)* YLIMIT/3)+1
6530 B4 = INT(RND(1)* YLIMIT/4)+1
6540 FOR I = 1 TO 300
6550     X1 = INT(RND(1)*B1)+1
6560     X2 = INT(RND(1)*B2)+1
6570     Y1 = INT(RND(1)*B3)+1
6580     Y2 = INT(RND(1)*B4)+1
6590     C = INT(RND(1)*6)+1
6600     IF C = 1 THEN
6600     IF C = 2 THEN C = 65
6610     IF C = 3 THEN C = 64
6620     IF C = 4 THEN C = 28
6630     IF C = 5 THEN C = 27
6640     IF C = 6 THEN C = 25
6650     RECT X1,Y1,X2,Y2, C
6660 NEXT I
6670 RETURN

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000
9672 RECT 62,54,85,73,CC

9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 PSET CX+4,CY,$25:GOSUB 9950:REM THE PUPILS OF HIS EYESRU
9710 CX = CX + 12:GOSUB 3000
9720 PSET CX+4,CY,$25:GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, $10:PSET CX -1,CY,$10
9955 PSET CX,CY -1,$10:PSET CX - 1, CY -1 ,$10
9960 RETURN
REM END FACE

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,192,$10
12520 LINE 55,145,53,192,$10
12525 LINE 53,193,70,193,$10
12530 RECT 56,145,69,192,$46
12535 LINE 55,157,55,192,$46
12540 LINE 54,181,54,192,$46

12555 LINE 57,144,71,144,$46
12560 RECT 69,142,71,154,$46
12565 RECT 72,142,73,153,$46
12570 LINE 63,143,68,143,$46
12575 PSET 70,155,$46

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1:CX=62:CY=208
12585 GOSUB 3000:RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12590 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12591 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12595 LINE 57,193,57,202,$10
12600 LINE 66,193,66,202,$10
12605 RECT 58,194,65,200,$1C
12610 RETURN

12619 REM LEFT LEG
12620 Q1=0:Q2=1:Q3=0:Q4=0
12625 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12630 GOSUB 3000
12635 LINE 77,157,77,192,$10
12640 LINE 90,145,92,192,$10
12645 LINE 77,193,92,193,$10
12650 RECT 78,145,89,192,$46
12655 LINE 90,157,90,192,$46
12660 LINE 91,181,91,192,$46

12665 LINE 74,144,88,144,$46
12670 RECT 76,143,79,154,$46
12675 RECT 74,142,76,153,$46
12680 LINE 74,143,82,143,$46
12685 LINE 77,154,77,156,$46

12689 REM THE FOOT
12690 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1
12695 CX=85:CY=208
12700 GOSUB 3000
12705 RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12710 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12715 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12720 LINE 80,193,80,202,$10
12725 LINE 89,193,89,202,$10
12730 RECT 81,194,88,200,$1C
12740 RETURN

35000 GET X$:IF X$<>"" THEN 35000 : REM FLUSH THE KEYBOARD BUFFER
35010 GET X$:IF X$="" THEN 35010 : REM WAIT FOR KEYBOARD
35020 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

BACKGROUND TWEAKS ... GAME IS CLOSE

Post by ahenry3068 »

I didn't change a lot tonight. If you only judge by the output graphics.
I did a lot of work on the "Grass" I'm really liking how that works and it
even runs a little more efficiently.

I left this Strange Gray/Black/White thing on the screen.......

It certainly doesn't belong there at this time, :)
I'm leaving it for the time being ...... BECAUSE... I've played with tons
of code trying to do this...... It is supposed to be a CLOUD..... This
is the closest I've gotten.... ( On a Ghz plus system we would certainly
just Ray Trace it...... I'm trying to do a good simulation with Random numbers)

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
120 GOSUB 12620 : REM THE LEFT LEG
190 GOSUB 35000 : REM WAIT FOR KEY
195 GOSUB 4000:GOSUB 35000
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM DEADFACE
4005 RA = 20
4010 CX = 74:CY = 63
4015 RA = RA -1
4020 RA = RA -1:RA = RA -1:XSQUISH=.8:YS=0
4030 RA = 17 :CC = $24:FILL=1:CY = CY + 1
4031 GOSUB 3000:CC=$B8:GOSUB 3000:CC=$C0:GOSUB 3000
4035 RECT 62,54,85,73,CC
4040 XS = 1:YS = XS
4045 CY = CY - 6:CX = CX - 6:RA=4:CC = $33:GOSUB 3000
4050 GOSUB 9950:REM THE PUPILS OF HIS EYES
4055 CX = CX + 12:GOSUB 3000
4060 GOSUB 9950:CX = 74:CY = 63
4065 LINE CX-1,CY, CX - 2, CY + 6, $10
4070 LINE CX+1,CY, CX + 2, CY + 6, $10
4075 LINE CX,CY,CX -1, CY + 6, $23
4080 LINE CX,CY,CX + 1, CY + 6, $23
4085 LINE CX,CY+3,CX,CY+6,$22
4090 Q3=0:Q4=0:CC=$3B:CY = CY + 13:YS=.35:RA=6:FILL=0
4095 GOSUB 3000
4100 CY = CY + 1:CC=$31:GOSUB 3000
4105 CY = CY + 1:CC=$3B:GOSUB 3000
4110 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
4200 RETURN

5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC
5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5046 REM BRUTE FORCE, RAYS FROM THE SUN...
5050 LINE 2,36,2,42,$07:LINE 6,36,6,43,$07
5051 LINE 9,36,10,42,$07:LINE 13,36,15,41,$07
5052 LINE 15,33,18,40,$07:LINE 18,33,21,39,$07
5053 LINE 20,31,24,38,$07:LINE 22,29,27,37,$07
5054 LINE 24,27,29,35,$07:LINE 27,25,32,32,$07
5055 LINE 30,23,35,29,$07:LINE 32,21,37,26,$07
5056 LINE 33,19,39,23,$07:LINE 35,17,41,20,$07
5057 LINE 36,15,42,17,$07:LINE 36,13,43,14,$07
5058 LINE 37,11,44,11,$07:LINE 37,8,44,8,$07
5060 LINE 37,5,45,5,$07:LINE 37,2,44,2,$07



5095 GOSUB 6500:REM DRAW A CLOUD
5110 RECT 0, 180, XLIMIT, YLIMIT, $85 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5171 COLOR 1
5180 GOSUB 6000:REM DRAW GRASS STUFF
5190 GOSUB 6000
5200 GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 35:REM RANDOM GRASS
6110     X1 = INT(RND(1)*310) + 5
6120     Y1 = INT(RND(1)*60) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*310) + 5:IF X2 = X1 THEN GOTO 6130
6140     Y2 = INT(RND(1)*60) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 55 OR X1 - X2 > 55 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 15 THEN GOTO 6110
6150     GOSUB 6400:LINE X1,Y1,X2,Y2, GC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6160     GOSUB 6200:X1=X2:Y1=Y2:GOSUB 6200
6180 NEXT I
6185 FOR I = 1 TO 10:X1=INT(RND(1)*310)+5:Y1=INT(RND(1)*4)+180
6186 GOSUB 6200:NEXT I
6190 RETURN

6200 GOSUB 6400
6210 LINE X1,Y1,X1-4,Y1-5,GC:GOSUB 6400
6215 LINE X1,Y1,X1-3,Y1-3,GC:GOSUB 6400
6220 LINE X1,Y1,X1,Y1-5,GC:GOSUB 6400
6225 LINE X1,Y1,X1+3,Y1-3,GC:GOSUB 6400
6230 LINE X1,Y1,X1+4,Y1-5,GC
6235 RETURN
6400 GC=INT(RND(1)*24)+$60:RETURN


6500 REM SUPPOSED TO BE A CLOUD HERE
6501 Q1=1:Q2=1:Q3=1:Q4=1:FILL=1
6510 DIM TY%(100):DIM BY%(100)
6511 DIM FX%(100):DIM BX%(100)
6540 FOR I = 1 TO 82
6550     TY%(I)=INT(RND(1)*15) + 10
6560     BY%(I)=INT(RND(1)*15) + 41
6570 NEXT I
6580 FOR X = 200 TO 270
6590     C = INT(RND(1)*16)+$10
6600     LINE X,TY%(X-199),X,TY%(X-198),C
6605     IF INT(RND(1)*10) < 6 THEN 6610
6606     CC=C:CX=X:CY=TY%(X-198):RA=INT(RND(1)*4)+3:GOSUB 3000
6610     C = INT(RND(1)*16)+$10
6620     LINE X,BY%(X-199),X,BY%(X-198),C
6630     IF INT(RND(1)*10) < 6 THEN 6650
6640     CX=X:CY=BY%(X-198):RA = INT(RND(1)*4)+3:CC=C:GOSUB 3000
6650 NEXT X

6660 FOR X = 200 TO 270
6665     C=INT(RND(1)*16)+$10
6666     BB = 199
6667     IF INT(X/2)=X/2 THEN BB = 197
6670     LINE X,TY%(X-199),X,BY%(X-BB),C
6675     IF INT(RND(1)*10) < 6 THEN 6700
6680     CX=X:CY=(BY%(X-199)-(BY%(X-199)-TY%(X-199))+INT(RND(1)*10))
6681     RA = INT(RND(1)*4)+3:CC=C
6682     GOSUB 3000
6700 NEXT X
6800 FILL=0:RETURN


7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8001 FILL = 0
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000
9672 RECT 62,54,85,73,CC


9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 PSET CX+4,CY,$25:GOSUB 9950:REM THE PUPILS OF HIS EYESRU
9710 CX = CX + 12:GOSUB 3000
9720 PSET CX+4,CY,$25:GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, $10:PSET CX -1,CY,$10
9955 PSET CX,CY -1,$10:PSET CX - 1, CY -1 ,$10
9960 RETURN
REM END FACE

9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,192,$10
12520 LINE 55,145,53,192,$10
12525 LINE 53,193,70,193,$10
12530 RECT 56,145,69,192,$46
12535 LINE 55,157,55,192,$46
12540 LINE 54,181,54,192,$46

12555 LINE 57,144,71,144,$46
12560 RECT 69,142,71,154,$46
12565 RECT 72,142,73,153,$46
12570 LINE 63,143,68,143,$46
12575 PSET 70,155,$46

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1:CX=62:CY=208
12585 GOSUB 3000:RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12590 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12591 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12595 LINE 57,193,57,202,$10
12600 LINE 66,193,66,202,$10
12605 RECT 58,194,65,200,$1C
12610 RETURN

12619 REM LEFT LEG
12620 Q1=0:Q2=1:Q3=0:Q4=0
12625 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12630 GOSUB 3000
12635 LINE 77,157,77,192,$10
12640 LINE 90,145,92,192,$10
12645 LINE 77,193,92,193,$10
12650 RECT 78,145,89,192,$46
12655 LINE 90,157,90,192,$46
12660 LINE 91,181,91,192,$46

12665 LINE 74,144,88,144,$46
12670 RECT 76,143,79,154,$46
12675 RECT 74,142,76,153,$46
12680 LINE 74,143,82,143,$46
12685 LINE 77,154,77,156,$46

12689 REM THE FOOT
12690 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1
12695 CX=85:CY=208
12700 GOSUB 3000
12705 RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12710 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12715 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12720 LINE 80,193,80,202,$10
12725 LINE 89,193,89,202,$10
12730 RECT 81,194,88,200,$1C
12740 RETURN

35000 GET X$:IF X$<>"" THEN 35000 : REM FLUSH THE KEYBOARD BUFFER
35010 GET X$:IF X$="" THEN 35010 : REM WAIT FOR KEYBOARD
35020 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

MUCH IMPROVED SCENE, WITH CLOUDS

Post by ahenry3068 »

Did a lot of tweaking on the background scene. I think the "Grass" is much improved.

Finally came up with an algorithm. That draws some reasonably believable (if cartoonish :) )
clouds in the sky. Found some Python code online that draws clouds.

The Python code actually drew an Oval then Traced out random arcs on the outside of the Oval.
Then it executes a floodfill which isn't available here yet.
I could have implemented that but it would be much to slow on the 65C02.

My code is pretty poky as it is. I defined a rectangle then proceeded to fill it with Circles
the X coordinate proceeds sequentially but the Y coordinate is randomized by about 6 pixels.
The Radius of the circle and the color is also randomized (the color is constrained to $1D to $1F)

Besides the speed of the code I'm pretty happy with the output. My current routine draws 3
clouds. Since the X & Y are random sometimes one is drawn on top of another, but that
sometimes comes out looking better.

HERES THE CURRENT CODE

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
120 GOSUB 12620 : REM THE LEFT LEG
190 GOSUB 35000 : REM WAIT FOR KEY
195 GOSUB 4000:GOSUB 35000
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM DEADFACE
4005 RA = 20
4010 CX = 74:CY = 63
4015 RA = RA -1
4020 RA = RA -1:RA = RA -1:XSQUISH=.8:YS=0
4030 RA = 17 :CC = $24:FILL=1:CY = CY + 1
4031 GOSUB 3000:CC=$B8:GOSUB 3000:CC=$C0:GOSUB 3000
4035 RECT 62,54,85,73,CC
4040 XS = 1:YS = XS
4045 CY = CY - 6:CX = CX - 6:RA=4:CC = $33:GOSUB 3000
4050 GOSUB 9950:REM THE PUPILS OF HIS EYES
4055 CX = CX + 12:GOSUB 3000
4060 GOSUB 9950:CX = 74:CY = 63
4065 LINE CX-1,CY, CX - 2, CY + 6, $10
4070 LINE CX+1,CY, CX + 2, CY + 6, $10
4075 LINE CX,CY,CX -1, CY + 6, $23
4080 LINE CX,CY,CX + 1, CY + 6, $23
4085 LINE CX,CY+3,CX,CY+6,$22
4090 Q3=0:Q4=0:CC=$3B:CY = CY + 13:YS=.35:RA=6:FILL=0
4095 GOSUB 3000
4100 CY = CY + 1:CC=$31:GOSUB 3000
4105 CY = CY + 1:CC=$3B:GOSUB 3000
4110 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
4200 RETURN



5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC
5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5046 REM BRUTE FORCE, RAYS FROM THE SUN...
5050 LINE 2,36,2,42,$07:LINE 6,36,6,43,$07
5051 LINE 9,36,10,42,$07:LINE 13,36,15,41,$07
5052 LINE 15,33,18,40,$07:LINE 18,33,21,39,$07
5053 LINE 20,31,24,38,$07:LINE 22,29,27,37,$07
5054 LINE 24,27,29,35,$07:LINE 27,25,32,32,$07
5055 LINE 30,23,35,29,$07:LINE 32,21,37,26,$07
5056 LINE 33,19,39,23,$07:LINE 35,17,41,20,$07
5057 LINE 36,15,42,17,$07:LINE 36,13,43,14,$07
5058 LINE 37,11,44,11,$07:LINE 37,8,44,8,$07
5060 LINE 37,5,45,5,$07:LINE 37,2,44,2,$07



5095 GOSUB 6500:GOSUB 6500:GOSUB 6500 REM DRAW CLOUDS
5110 RECT 0, 180, XLIMIT, YLIMIT, $85 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5171 COLOR 1
5180 GOSUB 6000:REM DRAW GRASS STUFF
5190 GOSUB 6000
5200 GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 35:REM RANDOM GRASS
6110     X1 = INT(RND(1)*310) + 5
6120     Y1 = INT(RND(1)*60) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*310) + 5:IF X2 = X1 THEN GOTO 6130
6140     Y2 = INT(RND(1)*60) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 55 OR X1 - X2 > 55 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 15 THEN GOTO 6110
6150     REM GOSUB 6400:LINE X1,Y1,X2,Y2, GC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6160     GOSUB 6200:X1=X2:Y1=Y2:GOSUB 6200
6180 NEXT I
6185 FOR I = 1 TO 10:X1=INT(RND(1)*310)+5:Y1=INT(RND(1)*4)+180
6186 GOSUB 6200:NEXT I
6190 RETURN

6200 GOSUB 6400
6210 LINE X1,Y1,X1-4,Y1-5,GC:GOSUB 6400
6215 LINE X1,Y1,X1-3,Y1-3,GC:GOSUB 6400
6220 LINE X1,Y1,X1,Y1-5,GC:GOSUB 6400
6225 LINE X1,Y1,X1+3,Y1-3,GC:GOSUB 6400
6230 LINE X1,Y1,X1+4,Y1-5,GC
6235 RETURN
6400 GC=INT(RND(1)*24)+$60:RETURN

6500 REM SUPPOSED TO BE A CLOUD HERE
6501 Q1=1:Q2=1:Q3=1:Q4=1:FILL=1
6540 H = INT(RND(1)*(150))+ 50
6541 HL = INT(RND(1)*30)+25
6545 V = INT(RND(1)*20) + 6
6550 VB = INT(RND(1)* 7) + 6
6555 FOR Y = V TO V+VB STEP 3
6560     FOR X = H TO H + HL STEP 3
6580         RA = INT(RND(1)*4)+3
6585         CC = INT(RND(1)*3)+ $1D
6590         CX=X
6592         CY= INT(RND(1)*4) + (Y-4):IF (CY - RA) < 0 THEN 6580
6600         GOSUB 3000
6605     NEXT X
6610 NEXT Y
6615 RETURN

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8001 FILL = 0
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000
9672 RECT 62,54,85,73,CC


9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 PSET CX+4,CY,$25:GOSUB 9950:REM THE PUPILS OF HIS EYESRU
9710 CX = CX + 12:GOSUB 3000
9720 PSET CX+4,CY,$25:GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, $10:PSET CX -1,CY,$10
9955 PSET CX,CY -1,$10:PSET CX - 1, CY -1 ,$10
9960 RETURN
REM END FACE


9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,192,$10
12520 LINE 55,145,53,192,$10
12525 LINE 53,193,70,193,$10
12530 RECT 56,145,69,192,$46
12535 LINE 55,157,55,192,$46
12540 LINE 54,181,54,192,$46

12555 LINE 57,144,71,144,$46
12560 RECT 69,142,71,154,$46
12565 RECT 72,142,73,153,$46
12570 LINE 63,143,68,143,$46
12575 PSET 70,155,$46

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1:CX=62:CY=208
12585 GOSUB 3000:RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12590 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12591 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12595 LINE 57,193,57,202,$10
12600 LINE 66,193,66,202,$10
12605 RECT 58,194,65,200,$1C
12610 RETURN


12619 REM LEFT LEG
12620 Q1=0:Q2=1:Q3=0:Q4=0
12625 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12630 GOSUB 3000
12635 LINE 77,157,77,192,$10
12640 LINE 90,145,92,192,$10
12645 LINE 77,193,92,193,$10
12650 RECT 78,145,89,192,$46
12655 LINE 90,157,90,192,$46
12660 LINE 91,181,91,192,$46

12665 LINE 74,144,88,144,$46
12670 RECT 76,143,79,154,$46
12675 RECT 74,142,76,153,$46
12680 LINE 74,143,82,143,$46
12685 LINE 77,154,77,156,$46

12689 REM THE FOOT
12690 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1
12695 CX=85:CY=208
12700 GOSUB 3000
12705 RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12710 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12715 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12720 LINE 80,193,80,202,$10
12725 LINE 89,193,89,202,$10
12730 RECT 81,194,88,200,$1C
12740 RETURN

35000 GET X$:IF X$<>"" THEN 35000 : REM FLUSH THE KEYBOARD BUFFER
35010 GET X$:IF X$="" THEN 35010 : REM WAIT FOR KEYBOARD
35020 RETURN

User avatar
ahenry3068
Posts: 1132
Joined: Tue Apr 04, 2023 9:57 pm

GOOD SPEED INCREASE ON CLOUDS

Post by ahenry3068 »

I revisited something I played with in an earlier version.
I tried to revise my circle routine from SIN/COS/PI to the Midpoint Algorithm

For whatever reason (most likely my BrainPower).. I couldn't get it to work
with all the parameters that I've introduced to do the drawing in this program.

For the cloud draw I'm not doing any of the extra parameters, Just 360 deg filled circles
Placed the mid point circle algorithm in my code at line 6800.

Doesn't do XSguish, YSquish or Clip.

It does use the same CX,CY, RA & CC variables as my other routine
But it only draw 360 deg circles, filled, that are entirely onscreen.
Thats all my Cloud drawing routine needs. And the speed increase is pretty dramatic.

So here is that CODE

Code: Select all

10 CLS:PRINT
15 XLIMIT = 319:YLIMIT=239
20 PI = 3.1416
25 Q1 = 1:Q2 = 1:Q3 = 1:Q4 = 1

35 PRINT "WELCOME TO HANGMAN"
40 PRINT " ONE PLAYER AGAINST THE COMPUTER ?
45 PRINT " OR HEAD TO HEAD ?"

55 SCREEN 128
60 GOSUB 5000 : REM BACKGROUND
65 GOSUB 7000 : REM GALLOWS
70 GOSUB 8000 : REM ROPE
80 GOSUB 9500 : REM THE GUYS HEAD
85 GOSUB 10000 : REM THE TORSO
90 GOSUB 11000 : REM THE LEFT ARM
100 GOSUB 12000 : REM THE RIGHT ARM
110 GOSUB 12500 : REM THE RIGHT LEG
120 GOSUB 12620 : REM THE LEFT LEG
190 GOSUB 35000 : REM WAIT FOR KEY
195 GOSUB 4000:GOSUB 35000
200 SCREEN 0:END

2998 REM CIRCLE,ELLIPSE AND ARC SUBROUTINE
2999 REM SINE/COSINE ALGORITHM
3000 Q = 1 / RA
3010 IF FILL = 1 THEN Q = .2/RA
3030 FOR I = 0 TO PI / 2 STEP Q
3040    DY = SIN(I) * RA
3050    IF YS > 0 AND YS < 1 THEN DY = DY*YS
3060    DX = COS(I) * RA
3070    IF XS > 0 AND XS < 1 THEN DX = DX*XS
3080    ZX = INT(CX - DX)
3090    ZY = INT(CY - DY)
3100    AX = INT(CX + DX)
3110    AY = INT(CY + DY)
3115    IF FILL = 1 THEN 3220
3120    IF AX<0 OR AX > XLIMIT OR AY<0 OR AY > YLIMIT OR Q4 = 0 THEN 3140
3130    PSET AX, AY, CC
3140    IF ZX<0 OR ZX>XLIMIT OR AY < 0 OR AY > YLIMIT OR Q3 = 0 THEN 3160
3150    PSET ZX, AY, CC
3160    IF AX<0 OR AX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q2 = 0 THEN 3180
3170    PSET AX, ZY, CC
3180    IF ZX<0 OR ZX > XLIMIT OR ZY<0 OR ZY > YLIMIT OR Q1 = 0 THEN 3300
3190    PSET ZX, ZY, CC
3200    GOTO 3300
3220    IF Q4<> 0 THEN LINE CX,CY,AX,AY,CC
3225    IF Q3<> 0 THEN LINE CX,CY,ZX,AY,CC
3230    IF Q2<> 0 THEN LINE CX,CY,AX,ZY,CC
3235    IF Q1<> 0 THEN LINE CX,CY,ZX,ZY,CC
3300 NEXT I
3310 RETURN

4000 REM DEADFACE
4005 RA = 20
4010 CX = 74:CY = 63
4015 RA = RA -1
4020 RA = RA -1:RA = RA -1:XSQUISH=.8:YS=0
4030 RA = 17 :CC = $24:FILL=1:CY = CY + 1
4031 GOSUB 3000:CC=$B8:GOSUB 3000:CC=$C0:GOSUB 3000
4035 RECT 62,54,85,73,CC
4040 XS = 1:YS = XS
4045 CY = CY - 6:CX = CX - 6:RA=4:CC = $33:GOSUB 3000
4050 GOSUB 9950:REM THE PUPILS OF HIS EYES
4055 CX = CX + 12:GOSUB 3000
4060 GOSUB 9950:CX = 74:CY = 63
4065 LINE CX-1,CY, CX - 2, CY + 6, $10
4070 LINE CX+1,CY, CX + 2, CY + 6, $10
4075 LINE CX,CY,CX -1, CY + 6, $23
4080 LINE CX,CY,CX + 1, CY + 6, $23
4085 LINE CX,CY+3,CX,CY+6,$22
4090 Q3=0:Q4=0:CC=$3B:CY = CY + 13:YS=.35:RA=6:FILL=0
4095 GOSUB 3000
4100 CY = CY + 1:CC=$31:GOSUB 3000
4105 CY = CY + 1:CC=$3B:GOSUB 3000
4110 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
4200 RETURN



5000 RECT 0,0, XLIMIT, YLIMIT, 14 : REM THE SKY
5010 CX = 5:CY=4:CC = $10:FILL = 0:XS=0:YS=0:RA = 33
5020 GOSUB 3000:RA=RA-.5:GOSUB 3000:RA=RA-.6:GOSUB 3000:RA = RA+1.2:GOSUB 3000
5030 CC = $07

5035 RECT 0,0,27,25,CC:RECT 0,26,22,29,CC
5036 RECT 0,30,19,31,CC:RECT 0,32,14,33,CC
5037 RECT 28,0,34,14,CC:RECT 28,14,31,20,CC
5045 FOR RA = 31 TO 29 STEP -.75:GOSUB 3000:NEXT RA:PSET CX,CY,$07
5046 REM BRUTE FORCE, RAYS FROM THE SUN...
5050 LINE 2,36,2,42,$07:LINE 6,36,6,43,$07
5051 LINE 9,36,10,42,$07:LINE 13,36,15,41,$07
5052 LINE 15,33,18,40,$07:LINE 18,33,21,39,$07
5053 LINE 20,31,24,38,$07:LINE 22,29,27,37,$07
5054 LINE 24,27,29,35,$07:LINE 27,25,32,32,$07
5055 LINE 30,23,35,29,$07:LINE 32,21,37,26,$07
5056 LINE 33,19,39,23,$07:LINE 35,17,41,20,$07
5057 LINE 36,15,42,17,$07:LINE 36,13,43,14,$07
5058 LINE 37,11,44,11,$07:LINE 37,8,44,8,$07
5060 LINE 37,5,45,5,$07:LINE 37,2,44,2,$07



5095 GOSUB 6500:GOSUB 6500:GOSUB 6500:GOSUB 6500 REM DRAW CLOUDS
5110 RECT 0, 180, XLIMIT, YLIMIT, $85 : REM THE GRASS
5120 FOR Y = 161 TO 179
5130     LINE 0, Y, 40, 179, 105
5140 NEXT Y
5150 FOR Y = 180 TO 150 STEP -1
5160     LINE 288,179, XLIMIT, Y, 105
5170 NEXT Y
5171 COLOR 1
5180 GOSUB 6000:REM DRAW GRASS STUFF
5190 GOSUB 6000
5200 GOSUB 6000
5210 RETURN
6000 FOR I = 1 TO 35:REM RANDOM GRASS
6110     X1 = INT(RND(1)*310) + 5
6120     Y1 = INT(RND(1)*60) + 180:IF Y1 > YLIMIT THEN GOTO 6120
6130     X2 = INT(RND(1)*310) + 5:IF X2 = X1 THEN GOTO 6130
6140     Y2 = INT(RND(1)*60) + 180:IF Y2 = Y1 OR Y2 > YLIMIT THEN GOTO 6140
6145     IF X2 - X1 > 55 OR X1 - X2 > 55 THEN GOTO 6110
6146     IF Y2 - Y1 > 12 OR Y1 - Y2 > 15 THEN GOTO 6110
6150     REM GOSUB 6400:LINE X1,Y1,X2,Y2, GC
6155     PSET X1, Y1 - 1, 133:PSET X1 , Y1-1, 104:PSET X2, Y1 - 3,107
6160     GOSUB 6200:X1=X2:Y1=Y2:GOSUB 6200
6180 NEXT I
6185 FOR I = 1 TO 10:X1=INT(RND(1)*310)+5:Y1=INT(RND(1)*4)+180
6186 GOSUB 6200:NEXT I
6190 RETURN

6200 GOSUB 6400
6210 LINE X1,Y1,X1-4,Y1-5,GC:GOSUB 6400
6215 LINE X1,Y1,X1-3,Y1-3,GC:GOSUB 6400
6220 LINE X1,Y1,X1,Y1-5,GC:GOSUB 6400
6225 LINE X1,Y1,X1+3,Y1-3,GC:GOSUB 6400
6230 LINE X1,Y1,X1+4,Y1-5,GC
6235 RETURN
6400 GC=INT(RND(1)*24)+$60:RETURN

6500 REM SUPPOSED TO BE A CLOUD HERE
6501 Q1=1:Q2=1:Q3=1:Q4=1:FILL=1
6540 H = INT(RND(1)*(150))+ 50
6541 HL = INT(RND(1)*30)+25
6545 V = INT(RND(1)*20) + 6
6550 VB = INT(RND(1)* 7) + 6
6555 FOR Y = V TO V+VB STEP 3
6560     FOR X = H TO H + HL STEP 4
6580         RA = INT(RND(1)*5)+3
6585         CC = INT(RND(1)*3)+ $1D
6590         CX=X
6592         CY= INT(RND(1)*4) + (Y-4):IF (CY - RA) < 0 THEN 6580
6600         GOSUB 6800
6605     NEXT X
6610 NEXT Y
6615 RETURN

6800 REM MIDPOINT CIRCLE ALGORITHM
6801 REM FILLED
6805 T1=RA/16:XA=RA:YA=0
6810 LINE CX+(XA),CY+(YA),CX-(XA),CY+(YA),CC
6815 LINE CX+(YA),CY+(XA),CX-(YA),CY+(XA),CC
6820 LINE CX+(XA),CY-(YA),CX-(XA),CY-(YA),CC
6825 LINE CX+(YA),CY-(XA),CX-(YA),CY-(XA),CC
6830 YA=YA+1
6835 T1=T1+YA
6840 T2=T1-XA
6845 IF T2 >= 0 THEN T1=T2:XA=XA-1
6850 IF XA>=YA THEN 6810
6855 RETURN

7000 REM THE GALLOWS
7010 FRAME 189,195,285,208,$10
7020 FRAME 188,194,285,211,$10
7021 LINE  189,210,285,210,$10
7022 PSET  189,209,$10
7023 PSET  284,206,$10
7024 PSET  284,209,$10
7030 FRAME 275,21,285,207,$10
7040 FRAME 276,22,284,205,$10
7050 FRAME 67,20,285,30,$10
7060 FRAME 68,21,284,29,$10
7070 RECT  71,30,79,33,$10
7080 RECT  190,196,283,209,$53
7090 RECT  277,23,283,209,$53
7100 RECT  69,22,283,28,83
7150 RETURN

8000 REM THE ROPE
8001 FILL = 0
8010 LINE 73,33,73,53,16
8020 LINE 77,33,77,53,16
8030 RECT 74,34,76,53,87
8040 FOR Y = 38 TO 53 STEP 3
8050     LINE 73, Y, 77, Y - 3, $10
8060 NEXT Y
8070 FRAME 71,53,80, 68, 16
8080 RECT 72,54,79,68,87
8090 FOR Y = 56 TO 68 STEP 4
8100     LINE 72,Y,79, Y-4, $10
8110 NEXT Y
8120 REM THE NOOSE
8130 RA = 24
8140 YS = .38

8150 CX = 75:CY = 79:CC = 16
8160 GOSUB 3000:RA=25:GOSUB 3000
8165 RA = 24:GOSUB 3000
8170 RA = 19:GOSUB 3000
8175 RA = 18:GOSUB 3000
8180 CC = 87
8190 FOR X = 20 TO 23 STEP .4
8200     RA = X:GOSUB 3000
8210 NEXT X
9000 YS=0:RETURN
REM END ROPE

9499 REM THE FACE
9500 CX = 59:CY = 60:RA = 6:XS = .4:CC = $10
9505 Q1=1:Q2=0:Q3=1:Q4=0
9510 GOSUB 3000:RA = RA - 1:GOSUB 3000

9520 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000

9530 FILL=0:CX = 89:RA = 6:CC=$10
9531 Q1=0:Q2=1:Q3=0:Q4=1
9540 GOSUB 3000:RA = RA - 1:GOSUB 3000
9550 RA = RA - 1:FILL = 1:CC = $25:GOSUB 3000
9551 Q1=1:Q2=Q1:Q3=Q1:Q4=Q1

9555 REM DRAW HIS NECK
9560 LINE 67,76,67,84,$10
9570 LINE 66,76,66,84,$10
9580 LINE 67,87,67,90,$10:LINE 66,87,66,90,$10
9590 LINE 82,76,82,84,$10
9600 LINE 83,76,83,84,$10
9605 LINE 82,87,82,90,$10:LINE 83,87,83,90,$10
9610 RECT 68,76,81,84,$25
9620 RECT 68,89,81,90,$25
9621 REM END NECK

9630 RA = 20:XS = .8:FILL = 0
9640 CC = $10:CX = 74:CY = 63
9650 GOSUB 3000:RA = RA -1:GOSUB 3000
9660 RA = RA -1:GOSUB 3000:RA = RA -1:GOSUB 3000
9665 CY = CY - 1:GOSUB 3000:CY = CY -1:GOSUB 3000:CY=CY + 2
9670 RA = RA :CC = $25:FILL=1:CY = CY + 1:GOSUB 3000
9672 RECT 62,54,85,73,CC


9680 XS = 1:YS = XS
9690 CY = CY - 6:CX = CX - 6:RA=4:CC = $01:GOSUB 3000
9700 PSET CX+4,CY,$25:GOSUB 9950:REM THE PUPILS OF HIS EYESRU
9710 CX = CX + 12:GOSUB 3000
9720 PSET CX+4,CY,$25:GOSUB 9950:CX = 74:CY = 63
9730 LINE CX-1,CY, CX - 2, CY + 6, $10
9740 LINE CX+1,CY, CX + 2, CY + 6, $10
9750 LINE CX,CY,CX -1, CY + 6, $23
9760 LINE CX,CY,CX + 1, CY + 6, $23
9770 LINE CX,CY+3,CX,CY+6,$22
9780 Q3=0:Q4=0:CC=$10:CY = CY + 13:YS=.35:RA=6:FILL=0
9790 GOSUB 3000
9800 CY = CY + 1:CC=$31:GOSUB 3000
9805 CY = CY + 1:CC=$10:GOSUB 3000
9806 Q3=1:Q4=1:YS=0: REM REMEMBER TO TURN CIRCLE FULLY ON !!!
9810 RETURN
9949 REM THE PUPILS
9950 PSET CX,CY, $10:PSET CX -1,CY,$10
9955 PSET CX,CY -1,$10:PSET CX - 1, CY -1 ,$10
9960 RETURN
REM END FACE


9999 REM THE TORSO
10000 LINE 82,90,105,93,$10
10005 LINE 83,91,105,94,$10

10010 LINE 68,90,42,93, $10
10015 LINE 69,91,42,94, $10

10020 LINE 67,90,74,105,$10
10025 LINE 83,90,74,105,$10

10026 REM THIS FOR LOOP FILLS IN THE NECKLINE
10030 FOR X = 81 TO 68 STEP -1
10035     LINE 75,103,X, 90, $25
10040 NEXT X

10053 LINE 74,105,72,110,$10
10054 LINE 72,110,72,141,$10

10055 LINE 72,141,53,144,$10
10060 LINE 53,144,53,108,$10

10065 RECT 71,140,54,103,$08
10066 LINE 54,141,68,141,$08
10067 LINE 54,142,62,142,$08
10068 LINE 54,143,56,143,$08
10069 PSET 65,91,$10
10070 LINE 72,102,72,108,$08
10071 LINE 73,104,73,106,$08

10072 PSET 74,109,$08

10073 RECT 47,107,68,94,$08
10074 RECT 69,96,69,99,$08
10076 RECT 42,107,48,95,$08
10077 LINE 56,93,67,93, $08:PSET 55,92,$10:PSET 64,91,$10
10078 LINE 65,92,67,92, $08
10079 RECT 68,100,71,102,$08
10080 LINE 70,98,70,100, $08

10090 RECT 73,110,91,140,$08
10095 RECT 75,105,91,109,$08

10120 RECT 88, 94, 101, 106, $08
10125 RECT 81, 95, 105, 106, $08
10130 LINE 80, 96, 80, 105, $08
10135 LINE 79,98,79,105, $08
10140 LINE 78,100,78,105,$08
10145 LINE 77,101,77,105,$08
10150 LINE 76,103,76,105,$08
10155 LINE 74,103,75,103, $10
10160 PSET 76,101,$10:PSET 73,101,$10:PSET 72,99,$10:PSET 71,97,$10
10165 PSET 70,95,$10:PSET 69,93,$10:PSET 81,92,$10:PSET 80,94,$10
10166 PSET 80,96,$10:PSET 78,97,$10:PSET 77,99,$10
10167 LINE 76,100,76,103,$10

10175 RECT 82, 94, 93, 93, $08
10180 LINE 83, 92, 86, 92, $08
10185 LINE 74, 107,74, 108,$08
10190 PSET 73,109,$10
10195 PSET 73,141,$10

10200 LINE 76,141,91,141,$08
10205 LINE 81,142,91,142,$08
10210 LINE 89,143,91,143,$08

10360 LINE 74,141,92,144,$10
10365 LINE 92,144,92,107,$10
12366 PSET 73,141,$10 : REM STRAY PIXEL AT WAISTLINE

REM SHIRT BUTTONS
10370 CC = 16:RA = 1
10375 CX = 76:FILL = 1
10385 FOR CY = 112 TO 142 STEP 8
10390     GOSUB 3000
10400 NEXT CY

REM POCKET AND PRISONER NUMBER
10410 LINE 58,108,68,108,$10
10415 LINE 58,108,58,116,$10
10420 LINE 68,108,68,116,$10
10425 Q1=0:Q2=0:Q3=1:Q4=1:RA=4.5:XSQUISH = 0:YSQUISH=.6
10430 CX = 63:CY=116:CC=$10:FILL=0
10435 GOSUB 3000
10440 CHAR 57,106,$10,"P-1"
10600 RETURN

10999 REM ARM ON THE RIGHT (LEFT ARM)
11000 Q1=0:Q2=1:Q3=0:Q4=0:FILL = 0
11010 XSQUISH = .52
11020 RA = 16:CC=$10
11030 CY = 116:CX = 92:
11035 GOSUB 3000:RA=RA+.6
11040 GOSUB 3000
11060 RA=RA-1:GOSUB 3000
11090 XSQUISH=.28:CX = 106:CY = 105:FILL=0
11095 GOSUB 3000
11096 FOR L = 1 TO 3:RA=RA+.5:GOSUB 3000:NEXT L
11100 CC = $08:Q1=0:Q2=1:Q3=0:Q4=0
11105 FOR RA = 14 TO 12 STEP -.7
11110   GOSUB 3000:IF RA =12 THEN Q1=1
11115 NEXT RA
11116 RECT CX-1,CY-3,CX+1,CY-7,$08
11120 LINE 99,115,99,133,$10
11130 LINE 111,102,111,133,$10
11135 RECT 100,102,110,133,$08
11140 LINE 99,107,99,109,$08
11145 LINE 98,108,101,108,$08
11150 LINE 97,107,100,107,$08 :PSET 94,107,$0E
11155 LINE 99,134,111,134,$10

11159 REM (THE LEFT HAND)
11160 LINE 101,134,101,143,$10
11165 LINE 101,143,103,143,$10
11166 LINE 102,142,102,139,$25

11170 LINE 103,144,103,140,$10
11175 LINE 103,145,105,145,$10
11176 LINE 104,144,104,139,$25

11180 LINE 105,146,105,140,$10
11185 LINE 105,146,107,146,$10
11186 LINE 106,145,106,139,$25

11190 LINE 107,146,107,140,$10
11195 LINE 107,145,109,145,$10
11196 LINE 108,144,108,139,$25

11200 LINE 109,145,109,134,$10
11205 RECT 102,139,108,135,$25
11210 RETURN

11999 REM ARM ON THE LEFT (RIGHT ARM)
12000 Q1=1:Q2=0:Q3=0:Q4=0:FILL = 0
12010 XSQUISH = .52
12020 RA = 16:CC=$10
12030 CY = 118:CX = 54
12035 GOSUB 3000:RA=RA+.6
12040 GOSUB 3000
12060 RA=RA-1:GOSUB 3000
12090  XSQUISH=.43:CX = 42:CY = 105:FILL=0

12095  GOSUB 3000
12096  FOR L = 1 TO 3:RA=RA+.3:GOSUB 3000:NEXT L
12100  CC = $08:Q1=1:Q2=0:Q3=0:Q4=0
12105  FOR RA = 14 TO 12 STEP -.7
12110   GOSUB 3000:IF RA =12 THEN Q1=1
12115  NEXT RA
12116  RECT CX-4,CY-8,CX+3,CY+6,$08
12117  RECT CX-4,CY-4,CX,CY+6,$08
12120  LINE 34,102,34,133,$10
12130  LINE 46,115,46,133,$10
12135  RECT 35,102,45,133,$08
12136  LINE 34,134,46,134,$10
12140  LINE 46,CY,46,CY+6,$08
12142  LINE 47,CY,47,CY+5,$08
12145  RECT 47,CY,49,CY+3,$08
12150  LINE 51,CY+4,52,CY+4,$0E
12155  PSET 48,CY+4, $08

12159 REM (THE LEFT HAND)
12160 LINE 44,134,44,143,$10
12165 LINE 44,143,42,143,$10
12166 LINE 43,142,43,139,$25

12170 LINE 42,140,42,145,$10
12175 LINE 42,145,40,145,$10
12176 LINE 41,144,41,139,$25

12180 LINE 40,146,40,140,$10
12185 LINE 40,146,38,146,$10
12186 LINE 39,145,39,139,$25

12190 LINE 38,146,38,140,$10
12195 LINE 38,145,36,145,$10
12196 LINE 37,144,37,139,$25

12200 LINE 36,145,36,134,$10
12205 RECT 43,139,37,135,$25
12210 RETURN

12499 REM RIGHT LEG
12500 Q1=1:Q2=0:Q3=0:Q4=0
12505 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12510 GOSUB 3000
12515 LINE 70,159,70,192,$10
12520 LINE 55,145,53,192,$10
12525 LINE 53,193,70,193,$10
12530 RECT 56,145,69,192,$46
12535 LINE 55,157,55,192,$46
12540 LINE 54,181,54,192,$46

12555 LINE 57,144,71,144,$46
12560 RECT 69,142,71,154,$46
12565 RECT 72,142,73,153,$46
12570 LINE 63,143,68,143,$46
12575 PSET 70,155,$46

12579 REM THE FOOT
12580 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1:CX=62:CY=208
12585 GOSUB 3000:RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12590 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12591 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12595 LINE 57,193,57,202,$10
12600 LINE 66,193,66,202,$10
12605 RECT 58,194,65,200,$1C
12610 RETURN


12619 REM LEFT LEG
12620 Q1=0:Q2=1:Q3=0:Q4=0
12625 CC=$10:CX=74:CY=159:RA=8:XQUISH=.10
12630 GOSUB 3000
12635 LINE 77,157,77,192,$10
12640 LINE 90,145,92,192,$10
12645 LINE 77,193,92,193,$10
12650 RECT 78,145,89,192,$46
12655 LINE 90,157,90,192,$46
12660 LINE 91,181,91,192,$46

12665 LINE 74,144,88,144,$46
12670 RECT 76,143,79,154,$46
12675 RECT 74,142,76,153,$46
12680 LINE 74,143,82,143,$46
12685 LINE 77,154,77,156,$46

12689 REM THE FOOT
12690 Q1=1:Q2=1:Q3=1:Q4=1:RA=20:XS=.35:CC=$10:FILL=1
12695 CX=85:CY=208
12700 GOSUB 3000
12705 RA=RA+1:FILL=0:CC=$12:GOSUB 3000:FILL=1
12710 XS=.38:CY=204:CC=$1C:RA=11:GOSUB 3000
12715 RA = RA + 1:CC=$12:FILL=0:GOSUB 3000
12720 LINE 80,193,80,202,$10
12725 LINE 89,193,89,202,$10
12730 RECT 81,194,88,200,$1C
12740 RETURN

35000 GET X$:IF X$<>"" THEN 35000 : REM FLUSH THE KEYBOARD BUFFER
35010 GET X$:IF X$="" THEN 35010 : REM WAIT FOR KEYBOARD
35020 RETURN
User avatar
desertfish
Posts: 1094
Joined: Tue Aug 25, 2020 8:27 pm
Location: Netherlands

Re: NEW GAME IN BASIC... HANGMAN EARLY DAYS.

Post by desertfish »

The wooden frame gets drawn straight over the clouds , that's a shame!
Maybe you should move the clouds a bit lower so that they're not drawn in vain?

Other than that, very well done so far! The details in the picture surprised me!
Post Reply