### » Thu Sep 04, 2008 9:45 pm

[quote="linkman2004":diezcipd]What I'm suggesting means you can still have a 16x16 grid to store additionaly information -- such as the author and player starting coordinates -- Basically, the -1 values wouldn't be recognized as a piece, so the spaces with -1 as the value wouldn't have any tiles. There would still be plenty of space for author name and starting coordinates. Example array to illustrate the point:

2222222222222BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2111111111112BBB
2222222222222BBB
BBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBBB
BBBBBBBBBBBBBBAP

2 = Wall
1 = Grass
B = Blank space, represented by -1
A = Represents author name
P = Starting player Coordinates

I hope that better illustrates the idea behind it.[/quote:diezcipd]

So the "B"s won't be recognized in the For each elements...
But the A and P will always be counted, and those aren't part of the gameplay
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

### » Thu Sep 04, 2008 10:04 pm

The A and P would only be recognized if you wanted them to be. As you have it now, it will only create pieces if the current cell is equal to that pieces identifier. You don't have it looking for -1, so it will skip over them. Likewise with the P and A, they will only be recognized if you want it to recognize them, otherwise they are merely there to store the information you want.
Moderator
B
115
S
41
G
20
Posts: 1,586
Reputation: 19,196

### » Thu Sep 04, 2008 10:15 pm

[quote="linkman2004":296kzxg8]The A and P would only be recognized if you wanted them to be. As you have it now, it will only create pieces if the current cell is equal to that pieces identifier. You don't have it looking for -1, so it will skip over them. Likewise with the P and A, they will only be recognized if you want it to recognize them, otherwise they are merely there to store the information you want.[/quote:296kzxg8]

Then how can I exclude P and A from "For...each cell" loop?

Anyway I'm going to sleep, if you can, could you kindly make me a example? Not based on the editor, even from scratch.

See ya tomorrow.
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

### » Thu Sep 04, 2008 10:50 pm

[quote="SuperV":ykeowui6]Then how can I exclude P and A from "For...each cell" loop?[/quote:ykeowui6]

What he's saying is, you don't need to exclude them. Yes, the loop will run, but nothing will happen when it sees the info in those cells (unless you want it to). And it's only two loops, it's not going to affect performance any.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

### » Thu Sep 04, 2008 11:41 pm

Alright, I pulled together an example showing how it all works. It includes a sample level and a fairly extensive read-me. I hope this can solve your problems.

Array Example
Moderator
B
115
S
41
G
20
Posts: 1,586
Reputation: 19,196

### » Fri Sep 05, 2008 11:24 am

[quote="linkman2004":1bypp9k7]Alright, I pulled together an example showing how it all works. It includes a sample level and a fairly extensive read-me. I hope this can solve your problems.

Array Example[/quote:1bypp9k7]

Thank you man! You solved lots of problems!
B
2
S
2
G
5
Posts: 512
Reputation: 2,674

### » Fri Sep 05, 2008 1:02 pm

Moderator
B
115
S
41
G
20
Posts: 1,586
Reputation: 19,196

Previous