WIP: Dungeon for 16k ZX81

Any discussions related to the creation of new hardware or software for the ZX80 or ZX81
Post Reply
Crayon21
Posts: 194
Joined: Sun Nov 04, 2018 2:33 am

WIP: Dungeon for 16k ZX81

Post by Crayon21 »

I have not posted on here in about a year or two but this is what i'm working on.

Things i finished:
Statistics (HP, AP and general data)
One monster already drawn
Things that need to be implemented:
XP
Structuring (Is there a forth compiler available?)
A map
permadeath and scoring

I am only able to upload a snapshot unfortunately but i hope it works

Been playing pathos on android, gave me a few ideas

what needs to be fixed? does anyone want to help?
Attachments
dung.z81
(5.17 KiB) Downloaded 24 times
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o
User avatar
XavSnap
Posts: 1333
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: WIP: Dungeon for 16k ZX81

Post by XavSnap »

Cap0000.jpg
Cap0001.jpg

Code: Select all

    5 DIM N(1)
    10 PRINT AT 10,0;"temple of horrors"
    11 INPUT N$
    12 PRINT "WELCOME TO YOUR DOOM"
    13 PRINT N$
    14 LET A$=INKEY$

# REM AVAILBLE AREAS ARE MARKED
    20  REM [HEX:\
26,3B,26,2E,31,27,31,2A,\
00,26,37,2A,26,38,00,26,\
37,2A,00,32,26,37,30,2A,\
29 ]

    21 PRINT "YOU ARE IN THE SPAWN AREA. YOU HAVE 10 HEALTH AND 0 XP"
    22 PRINT "SWORD AND SHIELD OR MAGE?"
    23 INPUT A$

# REM PEN AND PAPER NEEDED. MAGE GETS 
#     50 MAGIC BONUS
    24  REM [HEX:\
35,2A,33,00,26,33,29,00,\
35,26,35,2A,37,00,33,2A,\
2A,29,2A,29,1B,00,32,26,\
2C,2A,00,2C,2A,39,38,00,\
21,1C,00,32,26,2C,2E,28,\
00,27,34,33,3A,38 ]

    25 IF A$="SHIELD" THEN GOTO 130
    26 LET H=9
    27 LET W=0

# REM STAFF IS NOT A WEAPON
    28  REM [HEX:\
38,39,26,2B,2B,00,2E,38,\
00,33,34,39,00,26,00,3C,\
2A,26,35,34,33 ]

    29 GOSUB 100
    30 PRINT "EXPLORE THE MAZE OR REST?"
    31 LET A$=INKEY$
    32 IF A$="E"  THEN GOTO 40
    33 IF A$="R" THEN PRINT "YOUR MAX HEALTH IS REDUCED BY 1. YOU AWAKE BUT FEEL LIGHTHEADED"

# REM RESTING WITHOUT EATING REDUCES 1
#     HP
    34  REM [HEX:\
37,2A,38,39,2E,33,2C,00,\
3C,2E,39,2D,34,3A,39,00,\
2A,26,39,2E,33,2C,00,37,\
2A,29,3A,28,2A,38,00,1D,\
2D,35 ]

    35 LET F=0
    36 IF F>0 THEN LET H=1
    37 PRINT "EXPLORE FOR MONSTERS?"
    38 INPUT A$
    39 IF A$="Y" THEN PRINT "GENERATING MONSTERS..."
    40 LET M=34
    41 LET ATT=3

# REM MAX IS 3 DAMAGE
    42  REM [HEX:\
32,26,3D,00,2E,38,00,1F,\
00,29,26,32,26,2C,2A ]

    43 LET MHP=21
    44 PRINT "o««o"
    45 PRINT " mm"
    46 PRINT " ww"
    47 PRINT " »"
    48 PRINT "MONSTER ATTACKS FIRST"
    49 PRINT " *************"
    50 PRINT " ***************"
    51 PRINT "attack«phase"
    52 PRINT "****************"
    53 LET ATT=INT (1)
    54 PRINT "THE MONSTER ATTACKS YOU FOR ";AT;"DAMAGE"
    55 PRINT "USE SPELL OR DODGE?"
    56 INPUT A$
    57 IF A$="USE SPELL"  THEN PRINT "MAGIC CAST, NOW 42"

# REM DAMAGE TALLY
    58  REM [HEX:\
29,26,32,26,2C,2A,00,39,\
26,31,31,3E ]

    59 DIM D(2)
    60 LET D=30
    61 IF D>30 THEN PRINT "MONSTER HAS DIED"
    62 PRINT "YOU GET GOLD AND XP"

# REM GOLD AND XP TO BE ADDED LATER
    63  REM [HEX:\
2C,34,31,29,00,26,33,29,\
00,3D,35,00,39,34,00,27,\
2A,00,26,29,29,2A,29,00,\
31,26,39,2A,37 ]

   130 PRINT "STATS?"
   131 INPUT A$
   132 LET DF=SQR 3
   133 LET ATT=ACS 2
   134 PRINT DF,ATT

DUNG.P
(2.15 KiB) Downloaded 14 times
(You add to edit the "AT" lines (41-53-133), if the variable is tokenized as "PRINT "AT")
Xavier
User avatar
XavSnap
Posts: 1333
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: WIP: Dungeon for 16k ZX81

Post by XavSnap »

:oops:
Just let 2 lines between used one or take a step by 10 … it will easier to add a line...

Code: Select all

 
     5 DIM N$(1)
     6 LET XP=0
     7 LET G=0
     8 LET GL=0
     9 PRINT AT 10,7;"temple«of«horrors"
    10 GOSUB 1000
    11 GOSUB 500
    12 PRINT AT 10,0;"WELCOME TO YOUR DOOM"
    13 PRINT
    14 PRINT
    20 REM AVAILBLE AREAS ARE MARKED
    21 PRINT "YOU ARE IN THE SPAWN AREA.","YOU HAVE 10 HEALTH AND 0 XP"
    22 PRINT "sWORD AND sHIELD OR mAGE?"
    23 INPUT N$
    24 REM PEN AND PAPER NEEDED. MAGE GETS 50 MAGIC BONUS
    25 LET S$=N$
    26 LET H=9
    27 LET W=0
    28 REM STAFF IS NOT A WEAPON
    29 GOSUB 500
    30 PRINT "eXPLORE THE MAZE OR rEST?"
    31 INPUT N$
    32 IF N$="E"  THEN GOTO 40
    33 IF N$="R" THEN PRINT "YOUR MAX HEALTH IS REDUCED BY 1. YOU AWAKE BUT FEEL LIGHTHEADED"
    34 REM RESTING WITHOUT EATING REDUCES 1 HP
    35 LET F=0
    36 IF F>0 THEN LET H=1
    37 PRINT "EXPLORE FOR MONSTERS?"
    38 INPUT N$
    39 IF N$="Y" THEN PRINT "GENERATING MONSTERS..."
    40 LET M=34
    42 REM MAX IS 3 DAMAGE
    43 LET MHP=210
    44 PRINT ,,,,"o««o",," mm",," ww",," ¬ª",,"MONSTER ATTACKS FIRST"
    49 GOSUB 500
    50 PRINT " ****************","XP:";XP;"   H:";H,"G:";G,"****************"
    51 PRINT "   attack«phase",,"****************"
    53 LET ATT=INT (RND*10)-INT (RND*3) AND S$="S"
    54 PRINT "THE MONSTER ATTACKS YOU FOR",ATT;" DAMAGE"
    55 PRINT "USE sPELL OR dODGE?"
    56 INPUT N$
    57 IF N$="S"  THEN PRINT "MAGIC CAST, NOW..."
    58 REM DAMAGE TALLY
    60 LET D=INT (RND*60)-INT((RND*10+XP) AND N$="S")-INT((RND*15+XP) AND N$="D")
    62 LET R=40*RND*ATT/10
    63 IF D>=R THEN PRINT "MONSTER HAS DIED"
    64 IF D<R THEN GOTO 200
    65 LET G=INT (D-R)*2
    66 LET XP=XP+INT(R/2)
    67 REM GOLD AND XP TO BE ADDED LATER
    70 PRINT "YOU GET: GOLD:";G;" AND XP:";XP
    71 PRINT
    72 LET GL=GL+G
    73 LET H=H+INT((D-R)/10)
    75 GOTO 49 
   200 PRINT "THE MONSTER HIT YOU"
   210 LET H=H-INT((R-D)/10)
   220 GOTO 49
   500 FOR A=0 TO 11
   505 PRINT AT 9,0;("                                ") AND N$<>"E"
   510 SCROLL
   520 NEXT A
   530 PRINT AT 10,0;
   540 RETURN
   1000 FOR A=0 TO 100
   1010 IF INKEY$="" THEN NEXT A
   1020 RETURN
It's just an exemple...
DUNG2.P
(2.71 KiB) Downloaded 14 times
Xavier
User avatar
XavSnap
Posts: 1333
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: WIP: Dungeon for 16k ZX81

Post by XavSnap »

Crayon, i advice you to type-ins a listing and try to change lines to understand the Basic structure…
Try "The Minos maze": (Ordi5 issue 5)

http://zx81.ordi5.free.fr/n5/download/O ... _05_32.png
http://zx81.ordi5.free.fr/n5/download/O ... _05_33.png

Add monsters, levels…

My type-in is available here : (personal update!)
Image
http://abandonlistings.free.fr/ordi5/ZX81_6.htm
http://abandonlistings.free.fr/ordi5/hd ... /minos.zip
Xavier
Crayon21
Posts: 194
Joined: Sun Nov 04, 2018 2:33 am

Re: WIP: Dungeon for 16k ZX81

Post by Crayon21 »

sure thing
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o
Crayon21
Posts: 194
Joined: Sun Nov 04, 2018 2:33 am

Re: WIP: Dungeon for 16k ZX81

Post by Crayon21 »

XavSnap wrote: Tue Aug 03, 2021 8:41 pm Cap0000.jpg


Cap0001.jpg

Code: Select all

    5 DIM N(1)
    10 PRINT AT 10,0;"temple of horrors"
    11 INPUT N$
    12 PRINT "WELCOME TO YOUR DOOM"
    13 PRINT N$
    14 LET A$=INKEY$

# REM AVAILBLE AREAS ARE MARKED
    20  REM [HEX:\
26,3B,26,2E,31,27,31,2A,\
00,26,37,2A,26,38,00,26,\
37,2A,00,32,26,37,30,2A,\
29 ]

    21 PRINT "YOU ARE IN THE SPAWN AREA. YOU HAVE 10 HEALTH AND 0 XP"
    22 PRINT "SWORD AND SHIELD OR MAGE?"
    23 INPUT A$

# REM PEN AND PAPER NEEDED. MAGE GETS 
#     50 MAGIC BONUS
    24  REM [HEX:\
35,2A,33,00,26,33,29,00,\
35,26,35,2A,37,00,33,2A,\
2A,29,2A,29,1B,00,32,26,\
2C,2A,00,2C,2A,39,38,00,\
21,1C,00,32,26,2C,2E,28,\
00,27,34,33,3A,38 ]

    25 IF A$="SHIELD" THEN GOTO 130
    26 LET H=9
    27 LET W=0

# REM STAFF IS NOT A WEAPON
    28  REM [HEX:\
38,39,26,2B,2B,00,2E,38,\
00,33,34,39,00,26,00,3C,\
2A,26,35,34,33 ]

    29 GOSUB 100
    30 PRINT "EXPLORE THE MAZE OR REST?"
    31 LET A$=INKEY$
    32 IF A$="E"  THEN GOTO 40
    33 IF A$="R" THEN PRINT "YOUR MAX HEALTH IS REDUCED BY 1. YOU AWAKE BUT FEEL LIGHTHEADED"

# REM RESTING WITHOUT EATING REDUCES 1
#     HP
    34  REM [HEX:\
37,2A,38,39,2E,33,2C,00,\
3C,2E,39,2D,34,3A,39,00,\
2A,26,39,2E,33,2C,00,37,\
2A,29,3A,28,2A,38,00,1D,\
2D,35 ]

    35 LET F=0
    36 IF F>0 THEN LET H=1
    37 PRINT "EXPLORE FOR MONSTERS?"
    38 INPUT A$
    39 IF A$="Y" THEN PRINT "GENERATING MONSTERS..."
    40 LET M=34
    41 LET ATT=3

# REM MAX IS 3 DAMAGE
    42  REM [HEX:\
32,26,3D,00,2E,38,00,1F,\
00,29,26,32,26,2C,2A ]

    43 LET MHP=21
    44 PRINT "o««o"
    45 PRINT " mm"
    46 PRINT " ww"
    47 PRINT " »"
    48 PRINT "MONSTER ATTACKS FIRST"
    49 PRINT " *************"
    50 PRINT " ***************"
    51 PRINT "attack«phase"
    52 PRINT "****************"
    53 LET ATT=INT (1)
    54 PRINT "THE MONSTER ATTACKS YOU FOR ";AT;"DAMAGE"
    55 PRINT "USE SPELL OR DODGE?"
    56 INPUT A$
    57 IF A$="USE SPELL"  THEN PRINT "MAGIC CAST, NOW 42"

# REM DAMAGE TALLY
    58  REM [HEX:\
29,26,32,26,2C,2A,00,39,\
26,31,31,3E ]

    59 DIM D(2)
    60 LET D=30
    61 IF D>30 THEN PRINT "MONSTER HAS DIED"
    62 PRINT "YOU GET GOLD AND XP"

# REM GOLD AND XP TO BE ADDED LATER
    63  REM [HEX:\
2C,34,31,29,00,26,33,29,\
00,3D,35,00,39,34,00,27,\
2A,00,26,29,29,2A,29,00,\
31,26,39,2A,37 ]

   130 PRINT "STATS?"
   131 INPUT A$
   132 LET DF=SQR 3
   133 LET ATT=ACS 2
   134 PRINT DF,ATT

DUNG.P
(You add to edit the "AT" lines (41-53-133), if the variable is tokenized as "PRINT "AT")
why all the hex code?
zx81: great yet flawed
Zx spectrum: masterpiece that keeps on giving

(wish it weren't so expensive) :o
User avatar
XavSnap
Posts: 1333
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: WIP: Dungeon for 16k ZX81

Post by XavSnap »

Hi Crayon,
why all the hex code?
Just it's due to my text converter how assume all REM lines are in ASM…
In case of REMed text, all hex values give zx81 chars codes.
The reverse loading will give the exact text saved in binary codes.

In the second listing i had to delete binary to replace it to the readable zx81 chars…
Xavier
Post Reply