HTML Code:
import java.awt.Color;
import java.awt.Graphics;
public class levels
{
int level01[][] = { {2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2},
{2,1,2,2,2,2,2,2,2,2,2,2,2,2,2},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{2,2,2,2,2,2,2,2,2,2,2,2,2,2,2}};
public levels()
{
}
//@Override
public void paint(Graphics g)
{
for(int y = 0; y < level01.length; y++) //rows
{
for(int x = 0; x < level01[y].length; x++) //cols
{
if(level01[y][x] == 0)
{
g.setColor(Color.green);
g.drawRect(x, y, 200, 200);
}
if(level01[y][x] == 1)
{
g.setColor(Color.red);
g.drawRect(x, y, 200, 200);
}
if(level01[y][x] == 2)
{
g.setColor(Color.black);
g.drawRect(x, , 200, 200);
}
}
}//end of main for loop
//super.paint(g);
}//end of paint method
}//end of level01 class