1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42
| public class Mancala extends Canvas {
g.setColor(0xFFFFFF);
g.fillRect(0, 0, getWidth(), getHeight());
g.setColor(0x663333);
g.fillRect(x1, y1, y * nb, y1 * 2);
//dessin des deux grandes ellipses
g.setColor(0x5A2D05);
g.fillArc(x1, d, y, y1, 0, 360);
g.fillArc(x1 + (y * (nb - 1)), d, y, y1, 0, 360);
//dessin des cercles de la premiere rangée
g.setColor(0x5A2D05);
g.fillArc(a, (height * c) / 100, y, e, 0, 360);
g.setColor(0x461609);
g.fillArc(a, (height * c) / 100, y2, e1, 0, 360);
for (int i = 1; i <= (nb - 3); i++) {
g.setColor(0x5A2D05);
g.fillArc(a + (i * y), (height * c) / 100, y, e, 0, 360);
public void load() {
try {
// load the images
imgVan = Image.createImage("/images/van.png");
} catch (Exception ex) {
}
// initialize the Sprite object
Van = new Sprite(imgVan, 18, 18);
Van.setFrame(1);
Van.setPosition(a + (k * y), ((height * 20) / 100));
}
public void unload() {
// make sure the object gets destroyed
Van = null;
imgVan = null;
}
} |
Partager