So recently I have been working on a map movement code similar to A Dark Room. As the title says, it's map only, not the things inside your own village. I might program in some of the activities at the map locations later, not sure.
Currently the map generation is painfully slow, and some of the movement is a bit slow too. Sadly, I do not know the generation specifics, although I still have been able to get a little help from <here>. In the future, I plan to make the W (spaceship) only generate once, among several other changes…
Heres a screenie:
…and here's a current download link (mediafire.com) [Link]
Anyways, optimization would be greatly appreciated, especially for speed (and for size)!
PROGRAM:MAPGEN
//notice, the map is in a string - not a matrix (that would be too big)
" ->Str1
For(A,1,230
randInt(2,14
If randInt(0,14
1
Str1+sub("[plotdot]PMVOYHFBWSCIU",Ans,1->Str1 //[plotdot] is the little dot toward the end of the catalog
End
sub(Str1,2,104)+"A"+sub(Str1,105,125->Str1 //that way "A" is centered in the middle of the screen
PROGRAM:MAP
ClrDraw
24->A:48->B
Repeat K=45
6->N:Ans->O
4->P:Ans->Q
If not(A:0->N //faster than DelVar, although 1 byte bigger, I know.
If A=54:0->O
If not(B:0->P
If B=88:0->Q
For(C,A-N,A+O,6
For(D,B-P,B+Q,4
Text(C,D,sub(Str1,(23iPart(1+C/5.5)-22)+(D/4),1
End:End
Text(A,B,"a
sub(Str1,(23iPart(1+A/5.5)-22)+(B/4),1
If Ans!="plotdot" and Ans!="A
Then
ClrHome
Ans->Str9
1->Z
"!An Outpost!A Murky Swamp!A Damp Cave!A Deserted Town!A Ruined City!An Old House!A Forgotten Battlefield!A Huge Borehole!A Crashed Ship!The Sulphur Mine!The Coal Mine!The Iron Mine!A Destroyed Village!->Str8
For(I,1,inString("PMVOYHFBWSCIU",Str9
1+inString(Str8,"!",Z->Z //"!" is used as a delimiter
End
Output(1,1,sub(Str8,Z,inString(Str8,"!",Z)-Z
Pause
End
DispGraph
Repeat Ans
getKey->K
End
Text(A,B," //3 spaces
A+6((K=34)(A<54)-(K=25)(A>0->A
B+4((K=26)(B<88)-(K=24)(B>0->B
End