I have surfed in several sites and one question has founded allmost everywhere.
"I wana make text-based game. How i can know can my player move to x,y position or is there some wall etc...?"
Also my self have been some problems with "simple" things. Loading and saving on file was a major problem at first. It took like a 2 hours before i remembered it
So is there allready some simple moving tutorial allready?
Simple moving tutorial.
I am one of the owners of pure text
Hello. I have used text a great deal and know many things about using. I'll give you some code, Its just like using graphical maps
You can join Pure text if ya want.
Hope this helps anyway
Code: Select all
DIM map(100, 100)
FOR y = 1 TO 5
FOR x = 1 TO 5
READ map(x, y)
LOCATE y, x
IF map(x, y) = 1 THEN PRINT CHR$(219)
NEXT: NEXT
px = 2
py = 2
top:
LOCATE py, px: PRINT CHR$(2)
DO: P$ = INKEY$: LOOP UNTIL P$ <> ""
LOCATE py, px: PRINT " "
IF P$ = "8" AND map(px, py - 1) = 0 THEN py = py - 1
IF P$ = "5" AND map(px, py + 1) = 0 THEN py = py + 1
IF P$ = "4" AND map(px - 1, py) = 0 THEN px = px - 1
IF P$ = "6" AND map(px + 1, py) = 0 THEN px = px + 1
GOTO top
DATA 1,1,1,1,1
DATA 1,0,0,0,1
DATA 1,0,1,0,1
DATA 1,0,0,0,1
DATA 1,1,1,1,1
Hope this helps anyway