1020
minx=minx(hab):miny=miny(hab):maxx=maxx(hab):maxy=maxy(hab)
1030
FOR
i=1
TO joyar
1040
x=INT(RND*(maxx-minx+1))+minx
1050
y=INT(RND*(maxy-miny+1))+miny
1060
joyax(hab,i)=x:joyay(hab,i)=y
1070 joyas=joyas+1
1080
NEXT i
1090
FOR
i=1
TO objr
1100
x=INT(RND*(maxx-minx+1))+minx
1110
y=INT(RND*(maxy-miny+1))+miny
1120
objx(hab,i)=x:objy(hab,i)=y
1130
NEXT i
1140
joyas(hab)=joyar:obj(hab)=objr
1150
NEXT hab
1160
CLS
1170
RETURN
1180
ON rm GOTO
1190,1200,1210,1220,1230
1190
RESTORE 2680:RETURN
1200
RESTORE 2750:RETURN
1210
RESTORE 2820:RETURN
1220
RESTORE 2890:RETURN
1230
RESTORE 2970:RETURN
1240
PAPER 0:READ rm$:PAPER
1250
WINDOW
#1,minx(rm)-1,maxx(rm)+1,miny(rm)-1,maxy(rm)+1:CLS#1
1260
PEN 1:LOCATE 1,1:PRINT
1270
LOCATE
1,1:PRINT"Habitacion:
1280
IF
luces(rm)
1290
READ a$:IF
a$="FIN"
1300
IF
a$="D"
THEN
1310
IF
a$="W"
THEN
1320
IF
a$="L"
THEN GRAPHICS PEN 1:GOTO
1330
a$="S"
IF
THEN
1340
IF
a$="F"
THEN GRAPHICS PEN 6:GOTO
1350
PRINT"***ERROR
1360
STOP
1370
'
1380
'Dibujar joyas/objetos
1390
'
1400
PEN
6
1410
FOR
i=1
TO
obj(rm)
1420
LOCATE
objx(rm,i),objy(rm,i)
1430
PRINT
obj$;
1440
NEXT
1450
PEN
5
1460
FOR
i=1
TO
joyas(rm)
1470
LOCATE
joyax(rm,i),joyay(rm,i)
1480
PRINT
joya$;
1490
NEXT
1500
PEN 1:LOCATE xp,yp:PRINT
1510
RETURN
1520
xf=0:yf=0:PEN
1530
IF
INKEY(0)<>-1
1540
IF
INKEY(2)<>-1
1550
IF
INKEY(8)<>-1
1560
IF
INKEY(1)<>-1
8
SPACE$(19);
";rm$;
THEN INK 7,10:INK
THEN RETURN
2190
2270
2430
***";
hombre$;
1
OR
INKEY(72)<>-1
OR
INKEY(73)<>-1
OR
INKEY(74)<>-1
OR
INKEY(75)<>-1
Manual de Amstrad CPC 6128 (revisión 2008) - Página 419
8,10
ELSE INK 7,0:INK
2350
2350
yf=-1
THEN
THEN
yf=1
THEN
xf=-1
xf=1
THEN
8,0