User Tools

Site Tools


en:widget_factory

This is an old revision of the document!


WIDGET FACTORY

Info

Author ????????
Compatibility Amstrad PCW 8256 / 8512 / 9512
Year ????
Gender Arcade
Controls Keyboard
Language English
Status Preserved

Screenshots

Description

Something is wrong in the tool factory… the alarm sounds that gives us the warning of failure in the machinery systems, a conveyor belt has broken, and the belt has gone crazy. There are tools that are falling to the ground and breaking.

We have received a call from the Chief that has startled us. He wants us to go to the factory urgently and drive two heavy but very slow trucks to get the tools and avoid damage.

We'll be paid £10 per tool recovered, with a bonus if we take more than 50. But if we drop more than 10, we won't fill the bag and lose our job.

A game of skill and visual agility that will make us have a good time sitting in front of our PCW.

Listing

  • List - WIDGETS.BAS
10 OPTION RUN:GOSUB 760 :REM Initialize
20 WHILE k=1:GOSUB 40:GOSUB 680:WEND
30 PRINT e$"e"e$"1":MEMORY highmem!:END
40 missed=0:caught=0:POKE pn,255:POKE ppr,0:POKE dbl,1
50 y=23:FOR x=20 TO 68 STEP 2:a(x,y)=0:NEXT
60 PRINT cls$:x=10:x1=78:y=1:title$="WIDGET FACTORY
70 FOR a=1 TO LEN(title$):a$=MID$(title$,a,1)
80 CALL pr(x,y,a$):CALL pr(x1,y,a$):y=y+2:NEXT
90 POKE pn,85:POKE dbl,0:by1=5:by2=7:y1=25:y2=1:y3=3:FOR x=20 TO 68 STEP 2
100 CALL pr(x,by1,belt$):CALL pr(x,by2,belt$):CALL pr(x,y1,floor$)
110 CALL pr(x,y2,roof$):a(x,by1)=1:a(x,by2)=1:POKE pn,255
120 IF x<26 OR(x>32 AND x<40)OR(x>48 AND x<56)OR x>62 THEN CALL pr(x,y3,line$)
130 POKE pn,85:NEXT
140 POKE pn,255:POKE dbl,1:ty=23:tx(0)=30:tx(1)=54
150 FOR a=0 TO 1:truck$(a)=t3$:CALL pr(tx(a),ty,truck$(a)):NEXT
160 FOR a=0 TO 4 STEP 2:FOR b=0 TO 1:a(tx(b)+a,ty)=2:NEXT b,a
170 bx1(0)=22:bx1(1)=46:bx2(0)=66:bx2(1)=(42):s$=" "
180 wx(0)=22:wx(1)=36:wx(2)=52:wx(3)=66:POKE dbl,0
190 FOR a=0 TO 3:wy(a)=2:w1$(a)=w$(a):wx1(a)=wx(a):CALL pr(wx(a),wy(a),w$(a)):NEXT
200 y=27:x=24:a$="Press a key to start.":POKE dbl,1:CALL pr(x,y,a$)
210 WHILE INKEY$="":b=b+1:WEND:RANDOMIZE b
220 x=20:a$="Caught:"+STR$(caught)+SPACE$(6)+"Missed:"+STR$(missed)
230 CALL pr(x,y,a$)
240 REM Make everything move
250 WHILE missed<10:i$=INKEY$
260 REM Work conveyor belts
270 POKE pn,85:POKE dbl,0:FOR a=0 TO 1
280 CALL pr(bx1(a),by1,s$):bx1=bx1(a)-2:CALL pr(bx1,by1,belt$)
290 CALL pr(bx2(a),by2,s$):bx2=bx2(a)+2:CALL pr(bx2,by2,belt$)
300 a(bx1(a),by1)=0:a(bx2(a),by2)=0:a(bx1,by1)=1:a(bx2,by2)=1
310 bx1(a)=bx1(a)+2:IF bx1(a)=72 THEN bx1(a)=22
320 bx2(a)=bx2(a)-2:IF bx2(a)=16 THEN bx2(a)=66
330 NEXT
340 REM Drop widgets
350 POKE dbl,0:POKE pn,255
360 FOR a=0 TO 3
370 IF wy(a)=24 THEN GOSUB 630:PRINT CHR$(7);:POKE pn,85:CALL pr(wx1(a),wy(a),dust$):wy(a)=2:n=INT(RND*4):w1$(a)=w$(n):wx1(a)=wx(n):POKE pn,255:CALL pr(wx1(a),wy(a),w1$(a))
380 IF wy(a)=3 THEN s1$=line$ ELSE s1$=s$
390 IF wy(a)=5 OR wy(a)=7 THEN s1$=belt$:POKE pn,85
400 IF a(wx1(a),wy(a)+1)=0 THEN CALL pr(wx1(a),wy(a),s1$):POKE pn,255:wy(a)=wy(a)+1:CALL pr(wx1(a),wy(a),w1$(a))
410 IF a(wx1(a),wy(a)+1)=2 THEN GOSUB 650:PRINT CHR$(7);:CALL pr(wx1(a),wy(a),s$):wy(a)=2:n=INT(RND*4):wx1(a)=wx(n):w1$(a)=w$(n):CALL pr(wx1(a),wy(a),w1$(a))
420 NEXT
430 IF LOWER$(i$)="z"THEN GOSUB 490
440 IF LOWER$(i$)="x"THEN GOSUB 560
450 IF i$="/"OR i$="?"THEN GOSUB 520
460 IF i$="©"OR i$="@"THEN GOSUB 590
470 WEND:RETURN
480 REM Move trucks left...
490 POKE dbl,1:POKE pn,255:IF truck$(0)=t4$THEN truck$(0)=t3$:tx(0)=tx(0)+2:CALL pr(tx(0),ty,truck$(0))
500 IF tx(0)<=20 THEN RETURN ELSE tx(0)=tx(0)-2:CALL pr(tx(0),ty,truck$(0)):a(tx(0),ty)=2:a(tx(0)+6,ty)=0
510 RETURN
520 POKE dbl,1:POKE pn,255:IF truck$(1)=t4$THEN truck$(1)=t3$:tx(1)=tx(1)+2:CALL pr(tx(1),ty,truck$(1))
530 IF tx(1)<=46 THEN RETURN ELSE tx(1)=tx(1)-2:CALL pr(tx(1),ty,truck$(1)):a(tx(1),ty)=2:a(tx(1)+6,ty)=0
540 RETURN
550 REM ...and right
560 POKE dbl,1:POKE pn,255:IF truck$(0)=t3$THEN truck$(0)=t4$:tx(0)=tx(0)-2:CALL pr(tx(0),ty,truck$(0))
570 IF tx(0)>=38 THEN RETURN ELSE tx(0)=tx(0)+2:CALL pr(tx(0),ty,truck$(0)):a(tx(0)+6,ty)=2:a(tx(0),ty)=0
580 RETURN
590 POKE dbl,1:POKE pn,255:IF truck$(1)=t3$THEN truck$(1)=t4$:tx(1)=tx(1)-2:CALL pr(tx(1),ty,truck$(1))
600 IF tx(1)>=62 THEN RETURN ELSE tx(1)=tx(1)+2:CALL pr(tx(1),ty,truck$(1)):a(tx(1)+6,ty)=2:a(tx(1),ty)=0
610 RETURN
620 REM count hits or misses
630 POKE dbl,1:y=27:x=64:missed=missed+1:a$=STR$(missed)
640 CALL pr(x,y,a$):POKE dbl,0:RETURN
650 POKE dbl,1:y=27:x=34:caught=caught+1:a$=STR$(caught)
660 CALL pr(x,y,a$):POKE dbl,0:RETURN
670 REM Screen at end of game
680 POKE dbl,1:FOR a=0 TO 2000:NEXT:PRINT cls$
690 x=10:y=6:a$="Game over.":CALL pr(x,y,a$)
700 y=10:a$="You have caught"+STR$(caught)+" widgets.":CALL pr(x,y,a$)
710 y=14:pay=caught*10:IF caught>50 THEN pay=pay+(caught-50)*10
720 a$=STR$(pay):a$="You have earned £"+RIGHT$(a$,LEN(a$)-1)+".":CALL pr(x,y,a$)
730 x=10:y=20:a$="Play again?  (Y/N)":CALL pr(x,y,a$)
740 k=0:k$="":WHILE k=0 OR k$="":k$=LOWER$(INKEY$):k=INSTR("yn",k$):WEND:RETURN
750 REM Store machine code
760 highmem!=HIMEM:DEFINT a-z:MEMORY &HCFFF
770 e$=CHR$(27):cls$=e$+"E"+e$+"H"+e$+"0":RESTORE 1090
780 DIM a(70,26),w$(3),w1$(3),wx(3),wx1(3),wy(3),truck$(1),tx(1),ty(1),bx1(1),bx2(1)
790 PRINT cls$e$"rW I D G E T   F A C T O R Y
800 PRINT:PRINT e$"uAll is not well at the widget factory...
810 PRINT"A conveyor belt has broken, and valuable widgets are falling to the floor and breaking.
820 PRINT:PRINT"You have been employed to operate two heavy and slow-moving trucks which will
830 PRINT"catch the widgets and prevent damage.
840 PRINT:PRINT"You will be paid £10 per widget, with a bonus if you catch more than 50.
850 PRINT"But if you drop more than 10, you will get the sack.
860 PRINT:PRINT"Operate the left-had truck with 'Z' and 'X', and the right-hand one with '/' and '©'.
870 PRINT:PRINT"Press a key to start.
880 ad=&HE000:READ code:WHILE code<256:POKE ad,code:ad=ad+1:READ code:WEND
890 scrn=&HE000:pr=&HE003:udgs=&HD100:pn=&HD001:ppr=&HD000:dbl=&HD006
900 RESTORE 960:FOR i=0 TO 95:READ j:POKE UDGs+i,j:NEXT
910 t0$=CHR$(0):t1$=CHR$(1):t2$=CHR$(2):t$=t0$+t1$+t2$:t3$=t$+" ":t4$=" "+t$
920 floor$=CHR$(3):belt$=CHR$(4):line$=CHR$(5):roof$=CHR$(6)
930 w$(0)=CHR$(7):w$(1)=CHR$(8):w$(2)=CHR$(9):w$(3)=CHR$(10):dust$=CHR$(11)
940 k=1:PRINT e$"f":WHILE INKEY$="":WEND:CALL scrn:RETURN
950 REM UDG data
960 DATA 255,170,170,170,170,255,7,7
970 DATA 255,181,173,181,173,255,0,0
980 DATA 255,85,85,85,85,255,224,224
990 DATA 255,255,85,85,0,0,0,0
1000 DATA 255,0,102,102,0,255,0,0
1010 DATA 0,255,85,170,85,170,255,0
1020 DATA 85,85,255,255,0,0,0,0
1030 DATA 16,56,84,254,85,62,20,8
1040 DATA 8,24,56,120,56,24,8,126
1050 DATA 96,126,96,126,96,126,96,96
1060 DATA 195,255,24,24,24,60,126,255
1070 DATA 0,0,0,0,4,12,62,127
1080 REM Machine code
1090 DATA 195,6,224,195,91,224,205,41,224,17,152,44,33,0,182,1,104,1,62
1100 DATA 32,245,213,62,8,115,35,114,35,19,61,32,248,209,235,9,235,241,61
1110 DATA 32,236,201,193,205,90,252,233,0,201,102,26,111,34,2,208,10,50,16
1120 DATA 208,3,10,111,3,10,103,237,75,16,208,6,0,17,19,208,237,176,42
1130 DATA 2,208,205,252,224,34,4,208,33,19,208,34,17,208,201,205,48,224,205
1140 DATA 41,224,243,42,17,208,126,35,34,17,208,205,234,224,17,79,225,1,8
1150 DATA 0,237,176,221,42,4,208,14,8,253,33,79,225,42,0,208,125,6,8
1160 DATA 253,203,0,6,56,13,7,221,203,8,22,221,203,0,22,7,195,164,224
1170 DATA 203,4,221,203,8,22,221,203,0,22,203,4,221,203,8,22,221,203,0
1180 DATA 22,16,215,253,35,58,6,208,167,202,209,224,221,126,8,221,119,9,221
1190 DATA 126,0,221,119,1,221,35,121,254,5,194,209,224,1,200,2,221,9,79
1200 DATA 221,35,13,194,130,224,42,4,208,1,16,0,9,34,4,208,33,16,208
1210 DATA 53,194,98,224,251,201,17,0,184,254,32,48,3,17,0,209,111,38,0
1220 DATA 41,41,41,25,201,92,38,0,84,203,37,1,15,225,9,78,35,70,235
1230 DATA 41,41,41,9,201,48,89,0,92,208,94,160,97,112,100,64,103,16,106
1240 DATA 224,108,176,111,128,114,80,117,32,120,240,122,192,125,144,128,96,131,48
1250 DATA 134,0,137,208,139,160,142,112,145,64,148,16,151,224,153,176,156,128,159
1260 DATA 80,162,32,165,240,167,192,170,144,173,96,176,0,0,0,0,0,0,256

Controls

       Z = LEFT (Truck Left)
       X = RIGHT (Left Truck)
      
       / = LEFT (Truck Right)
       © = RIGHT (truck right)
      
       Q = ABANDON

Loading the program

 1.- Insert the CP/M disc on side 2
 2.- Write BASIC and wait for it to load
 3.- Remove the CP/M disk and insert the disk containing the Widget Factory game
 4.- Type run "Widgets" and press the "ENTER" key

Download

en/widget_factory.1655706066.txt.gz · Last modified: 2022/06/20 09:21 by jevicac