We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Array bidimensional
Page Index Toggle Pages: 1
Array bidimensional (Read 906 times)
Array bidimensional
Aug 31st, 2008, 12:49pm
 
Hi , I am doing a game like "zelda" ,but i have a problem.
I want to load the images like tiles in array(for example,map)
i use: int[] map = { 1,0,1,0,1,etc.,
                    1,0,1,0,1,etc.}
and i use "tile = map[1][2];" but processing makes a mistake.
if i use int[][] map; ,it do the same.
It's possible use a bidimensional array in processing?

Bye
Re: Array bidimensional
Reply #1 - Aug 31st, 2008, 1:15pm
 
Code:

int[][] map = new int[][]{
{1,2,3,4},
{5,6,7,8}
};

println( map[0] );
println( map[1] );


F
Re: Array bidimensional
Reply #2 - Aug 31st, 2008, 1:32pm
 
fjen wrote on Aug 31st, 2008, 1:15pm:
Code:

int[][] map = new int[][]{
   {1,2,3,4},
   {5,6,7,8}
};

println( map[0] );
println( map[1] );


F


Thank you! It work fine now! thanks!
Page Index Toggle Pages: 1