Login
Back to forumReply to this topicGo to last reply

Posted By

Dunric
on 2004-07-02
01:06:54
 The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

1 DATA 99,99,99,99,99,99,9,16,14,19,5,18,1,9,"NORTH","SOUTH","EAST","WEST","UP","DOWN", "HOBBIT","WEREWOLF","DRAGON","VAMPIRE","SWORD","PLATEMAIL","HELMET","CLOAK"
2 DATA 0,2,0,0,0,0,1,6,3,0,0,0,4,0,0,2,0,0,0,3,5,0,0,0,0,0,0,4,0,0,2,12,7,10,0,0,0,0,11,6,8, 0,0,0,9,0,0,7,0,0,0,8,0,0,0,0,6,0,0,0,0,13,0,7,0,0,6,15,0,0,0,0,11,0,14,0,0,0,0,0,0,13,0,0,12, 16,0,0,0,0,15,0,0,17,0,0,18,0,16,19,0,0,0,17,0,0,0,0,0,0,17,0,0,0
3 DATA"IN A TAVERN","BY A WELL","IN A CHURCH","AT AN ALTAR","IN STORAGE", "NEAR A VILLAGE","BY A TREE","UP THE TREE","IN A HUT","AT A MOUNTAIN","IN A MEADOW", "IN A FOREST","AT A CLEARING","BY A LAKE","ON A BRIDGE","BY A CASTLE","IN A HALLWAY","IN A ROOM"
4 DATA"BY A THRONE","GO","GET","DROP","USE","EXAMINE","LOOK","KILL","INVENTORY","QUIT","HELP","ODD CREATURE","HAS FIERY EYES","HAS TOUGH SCALES","A BLOOD FIEND","BLOOD SWORD","IRON PLATEMAIL","BRASS HELMET","ELVEN CLOAK"
5 DIM L(25),O$(25),M(25,15),D$(25),DE$(25),VB$(25):FOR X=1 TO 14:READ L(X):NEXT:FOR X=1 TO 14:READ O$(X):NEXT:FOR X=1 TO 19:FOR Y=1 TO 6:READ M(X,Y):NEXT Y:NEXT X:S$="SLICED":M$="MISSED"
6 FOR X=1 TO 19:READ D$(X):NEXT:FOR X=1 TO 10:READ VB$(X):NEXT:FOR X=7 TO 14:READ DE$(X):NEXT: P=125:R=1:?"B-VENTURE":?:?"'CAN YOU SLAY THE VAMPIRE?'":?
7 ?"YOU ARE ";D$(R):?"< ";:FOR X=1 TO 6:IF M(R,X)>0 then?O$(X);" ";
8 NEXT:?">":FOR X=7 TO 14:IF L(X)=R then?O$(X);"."
9 NEXT
10 V=0:N=0:Z=0:A$="":XL$="":N$="":V$="":?">";:OPEN 2,0:INPUT#2,A$:CLOSE 2:FOR X=1 TO LEN(A$):IF MID$(A$,X,1)=" " THEN V$=LEFT$(A$,X-1):Z=X
11 NEXT:N$=MID$(XL$,Z+1,X):GOSUB 51:FOR X=1 TO 10:IF VB$(X)=V$ THEN V=X
12 NEXT:FOR X=1 TO 14:IF O$(X)=N$ THEN N=X
13 NEXT:ON V GOTO 15,18,20,22,24,7,26,43,48,53
14 GOTO 23
15 IF M(R,N)=0 THEN 23
16 IF R=16 AND N=4 AND L(8)=R then?"IT GROWLS,'LEAVE, NOW!'":GOTO 10
17 R=M(R,N):GOTO 7
18 IF N<11 OR L(N)<>R THEN 23
19 L(N)=101:GOTO 22
20 IF N<11 OR L(N)<100 THEN 23
21 L(N)=R
22 ?"OK.":GOTO 10
23 ?"HOW?":GOTO 10
24 IF L(N)<>R AND L(N)<100 THEN 23
25 ?O$(N);":";DE$(N):GOTO 10
26 IF L(N)<>R OR N<7 OR N>10 THEN 23
27 GOSUB 52:T=INT(RND*250)+1
28 GOSUB 52:?">YOU ";:U=2:IF L(11)>99 THEN U=8
29 IF I<5 OR I>6 then?M$
30 IF I=5 then?"HIT IT":T=T-U*2
31 IF I=6 then?S$;" IT":T=T-U*4
32 IF T<1 then?"KILLED IT": P=P+99:GOTO 45
33 ?">THEY ";:U=8
34 IF L(12)>99 THEN U=U-3
35 IF L(13)>99 THEN U=U-2
36 IF L(14)>99 THEN U=U-1
37 GOSUB 52:IF I<5 OR I>6 then?M$
38 IF I=5 then?"HIT YOU": P=P-U*2
39 IF I=6 then?S$;" YOU": P=P-U*4
40 IF P<1 then?"ENDED YOU":GOTO 48
41 ?"@ HIT A KEY @":GOSUB 49:GOTO 28
43 FOR X=7 TO 14:IF L(X)>100 then?" ";O$(X)
44 NEXT:GOTO 10
45 L(N)=99:IF N=10 THEN 47
46 GOTO 10
47 ?"YOU WON!"
48 ?:?"@ GAME OVER @":END
49 A$=INKEY$:IF A$="" THEN 49
51 IF V$="" THEN V$=N$
52 I=INT(RND(1)*8)+1:RETURN
53 FOR X=1 TO 10:?VB$(X);" ";:NEXT:?:GOTO 10

Posted By

Csabo
on 2004-07-02
10:15:14
 Re: The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

Why did you post this? Do you want us to debug and fix it for you? As it is, your program will not run on any 264 series machine (INKEY$ in line 49 for one).

This is consistent with the quality of your other releases. Dyania locks you into two rooms right at the beginning from which there's no escape. Esotera has (at least) three bugs.

It's good that you are developing for the Plus/4, we have too few active programmers left. It is not so good however, when the things you release are of poor quality. My (unsought) advice to you is to spend more time testing your software and try to fix all bugs before making a release, you will probably get a much more positive feedback.

Posted By

Ulysses777
on 2004-07-02
14:24:49
 Re: The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

INKEY$ won't work on any Commodore machine.

Depending on the machine, it'll either cause a TYPE MISMATCH error, or be interpreted as a variable (IN$).

Posted By

Dunric
on 2004-07-04
05:24:00
 Re: The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

All of my Commodore adventure games are available below:

http://panks.freeshell.org/pauladv.html

Most don't have the errors described in Esotera, but you are correct that some do. I do need to work on fixing errors. "Westfront 64" (which also works on the Plus/4) is fairly
error free.

I posted a working version of my game above, which runs on the VICE emulator, for
the Commodore 64/128, Vic-20 and Plus/4:

http://panks.freeshell.org/bvent.html

edit: text copied from webpage skipped, see above link

Sincerely,

Paul Allen Panks
dunric@yahoo.com

Posted By

Csabo
on 2004-07-04
11:50:20
 Re: The <3KB Adventure game (for the unexpanded Vic-20 and 264 series)

It's far from optimized.

35 l(n)=99:if n=10 then 37
36 goto 4
37 print "you won!


could simply be

35 l(n)=99:if n<>10 then 4
37 print "you won!


Line 45 does not have to be in a separate basic line. Starting a new line (instead of appending it to the previous one with a colon) is 3 bytes extra.

You seem to be changing the color for VIC 20 and C64 (but not the Plus/4). The most obvious change could be not to do this at all. But even if you do, the VIC 20's poke is probably harmless on the C64 and the Plus/4, so you could just perform it without the costly PEEK.

Some of the subroutines are that only called once (lines 43, 46, 49) do not have to be a subroutine at all. You are wasting a gosub and a return.

Don't know about the VIC 20 or the C64, but for the Plus/4 it's useless to perform the CLR at the beginning.

There are probably a lot more things, but these are the most obvious ones I can see just by looking at it once.



Back to topReply to this topic


Copyright © Plus/4 World Team, 2001-2024