Código Java:
En el paquete Images solo estan las imagenes para que funcionen los autos. Espero su ayuda muchas gracias. Ver original
package ciudad; public class Auto { Image imagen; public int x; public int y; public int velocidad; this.imagen = t.getImage("auto.gif"); this.x = x; this.y = y; this.velocidad = velocidad; } } package ciudad; i public class Interfaz { private final int LARGO_IMAGENES = 15; private final int ALTURA_IMAGENES = 15; Pixel x = new Pixel("x", 0, "9", cin); Pixel a = new Pixel("rigth", 1, null, cua); // calle derecha Pixel b = new Pixel("left", 2, null, tre); //calle izquierda Pixel c = new Pixel("down", 3, null, dos); // calle abajo Pixel d = new Pixel("up", 4, null, uno); // calle arriba Pixel e = new Pixel("e", 5, null, inter); // interseccion public Pixel InterfazActual[][] = { {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, e}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, e}, {c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, e}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, e}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, c, c, c, c, e, e}, {d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, d, d, d, d, e, e}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b}, {x, x, x, x, a, x, x, x, x, a, x, x, x, x, b, x, x, x, x, a, x, x, x, x, a, b},}; return InterfazActual[Fila][Columna].getTipo(); } public int DevolverLargoImagenes() { return LARGO_IMAGENES; } public int DevolverAlturaImagenes() { return ALTURA_IMAGENES; } public int DevolverSentido(int Fila, int Columna) { return InterfazActual[Fila][Columna].getSentido(); } } package ciudad; public class Pixel { this.tipo = tipo; this.sentido = sentido; this.contiene = contiene; this.panel = panel; } return panel; } this.panel = panel; } return tipo; } this.tipo = tipo; } return sentido; } this.sentido = sentido; } return contiene; } this.contiene = contiene; } }