Here's the high score table code from Duck Hunter 3D:
dim highscores(5,10)
dim highscores$(5,10)
if file exist("hiscore.dat")=1
open to read 1,"hiscore.dat"
for j=0 to 4
for i=0 to 9
read word 1,highscores(j,i)
read string 1,highscores$(j,i)
next i
next j
close file 1
else
data 10000,9000,8000,7000,6000,5000,4000,3000,2000,1000
data "AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA"
data 60,70,80,90,100,110,120,130,140,150
data "AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA"
data 60,50,40,30,25,20,15,10,5,1
data "AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA"
data 40000,36000,32000,28000,24000,20000,16000,12000,8000,4000
data "AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA"
data 20000,18000,16000,14000,12000,10000,8000,6000,4000,2000
data "AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA","AAA"
for j=0 to 4
for i=0 to 9
read highscores(j,i)
read highscores$(j,i)
next i
next j
open to write 1,"hiscore.dat"
for j=0 to 4
for i=0 to 9
write word 1,highscores(j,i)
write string 1,highscores$(j,i)
next i
next j
close file 1
This code contains bits for reading and writing arrays into a file.
You'll need a string array of location descriptions, both long and short, and a flag array saying which directions you can go in. Also a string array of object names and descriptions, a number array of object positions relating to the index of the location arrays, and a similar set for enemies. You'll have to hardcode enemy behaviour, but then you could program several behaviour sets and assign one to each enemy, making different types move and attack differently.
Once I was but the learner,
now, I am the Master.