hi all,
i am new to programing forums, i am here to ask a help, please if any of u r able to help me i would be great full to u and may be able to help u or others in the future.
i am making a pacman game on J2ME for my programming project, and i am stuck at displaying the tiles/objects on the mobile screen, i made it an applet first and it was working, but when i tried to convert it to midlet i was stuck and had problems in the canvas class.
this is my pain method which worked fine as an applet but not in midlet.
public void paint(Graphics gr)
{
//g will get picture which will get the images
Graphics g = picture.getGraphics();
for(int i=0;i<Farm.board.length;i++){
for(int j=0;j<Farm.board[i].length();j++){
// String ImageName=null;
String s;
if (pacman.isAt(i,j))
s= pacman.Show();
else
s = Farm.fieldArray[i][j].Show();
char c = s.charAt(1);
Image im = null;
if(c=='W')
im = wallpix;
else if(c=='P')
im = pacmanpix;
else if(c=='o')
im = orangepix;
else im = fieldpix;
if (im != null)
g.drawImage(im,j*10,i*10,Graphics.TOP | Graphics.LEFT);
}
}
gr.drawImage(picture, 0, 0, 200, 200, null);
// Copy the Image to the screen
g.drawImage(picture, 0, 0, Graphics.TOP | Graphics.LEFT);
}
this is my email please help me and send me or reply to me here but am not sure how to check it, am new here.
<snipped email>
after i gain the necessary experience i intend to make more games and post it in as many programming sites as possible so others like me can find help easier in programming.