i was able to use the array to display things, and this is what i came up with...
import java.util.*;
import java.applet.*;
import java.awt.*;
import javax.swing.*;
public class Adventure extends JApplet implements Runnable
{
Image grass;
Image player;
int array[][]={ {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,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},{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,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},{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,0,0,0,0,0,0,0,0,0,0},{0,0,0,0,0,0,0,0,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,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,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,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,0,0,0,0,0,0,0,0,0,0,0}};
public void init()
{
load_image();
setBackground(Color.black);
}
public void run()
{
}
public void paint(Graphics g)
{
checkBackground();
int col;
int row;
for(row=0;row<15;row++)
{
for(col=0;col<20;col++)
{
if(array[row][col]==0)
{
g.drawImage(grass,(col*31),(row*31),this);
}
else if(array[row][col]==1)
{
g.drawImage(player,(col*31),(row*31),this);
}
}
}
}
public void update()
{
}
public void checkBackground()
{
}
public void load_image()
{
grass = getImage(getCodeBase(),"grass.png");
player = getImage(getCodeBase(),"player.png");
}
}
that is kinda what I was trying to do. Is there a better way? If so any help is appreciated :)