import javax.microedition.lcdui.*; public class LevelOne extends Canvas { private LayerManager layerManager; private TiledLayer tiledLayer; private final int WIDTH_SCREEN = getWidth(); private final int HEIGHT_SCREEN = getHeight(); public LevelOne() { layerManager = new LayerManager(); tiledLayer = new TiledLayer(9, 9, Image.createImage("/bg.png"), 40, 40); layerManager.append(tiledLayer); layerManager.setViewWindow(0, 0, WIDTH_SCREEN, HEIGHT_SCREEN); createBackground(); } public void createBackground() { for (int row=0; row<10; row++) { for ( int col=0; col<10; col++) { tiledLayer.setCell(row, col, 1); } } } public void paint(Graphics g) { layerManager.paint(g, 0, 0); } }