Posted: 30th Oct 2011 16:53
Iam pretty bad at this in programming

I found an awesome raycast tutorial and to do it simple so did i want to use that codes map file that looks like this!

// a 32x24 block map
var map = [
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,2,0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,2,0,0,0,0,2,2,2,2,2,2,2,2,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,0,0,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
...
[1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1],
[1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1]
];

How do i put it in to an agk array the simple way?

Ps..
I whas browsing for fun on raycasting engines on the amiga when i found this tutorial that i have planned to put in to the agk codebase.
Posted: 31st Oct 2011 11:55
+ Code Snippet
dim my_array[32,24] as integer
`then...column,row...
my_array[1,1]=1
my_array[2,1]=1
my_array[3,1]=1
my_array[4,1]=1
my_array[5,1]=1
my_array[6,1]=1
my_array[7,1]=1
my_array[8,1]=1
`etc.


Personally I would put the data into a text file and read it line by line.
Posted: 31st Oct 2011 14:27
Cliff, I would do what baxslash just said, read from a file as it would be far more simpler.
Posted: 31st Oct 2011 18:43
Thanks For the input

I solved it for now with an random map
Posted: 31st Oct 2011 19:12
or you can use:

+ Code Snippet
level$[0]="1111111111"
level$[1]="1        1"
level$[2]="1   22   1"

etc...

for y=0 to 9
 for x=1 to 10
  l$=mid(level$[y],x,1)
  if l$="1"
   // Draw 1 stuff
  endif
  if l$=" "
   // Draw noting
  endif

  etc...

 next x
next y