Hi all! I’ve been having problems with exporting the code into an application. When I run the application the only thing that shows up is a blank grey screen. This has happened with all the few programs I’ve tried to export. (They all run perfectly on Processing). Here’s the code of the latest one I tried exporting:
Thanks!
> boolean game = false;
> boolean ganar = false;
> int xpos, ypos;
>
> PImage catintro;
> PImage fondo;
> PImage title;
> PImage taco;
> PImage jugar;
> PImage instruccion;
> PImage kitty;
> PImage tacoman;
> PImage gano;
> PImage jugar2;
>
> Gato []cat;
> int numgato = 200;
> int cualgato;
>
> Taco man;
>
> void setup () {
> size (1000, 700);
> //frameRate (120);
> imageMode (CENTER);
> //smooth();
> //background (255);
>
>
> catintro = loadImage ("tacocat.png");
> fondo = loadImage ("background.png");
> title = loadImage ("title.png");
> taco = loadImage ("taco intro.png");
> jugar = loadImage ("jugar.png");
> instruccion = loadImage ("instruccion.png");
> kitty = loadImage ("cat juego.png");
> tacoman = loadImage ("taco juego.png");
>
> gano = loadImage ("gano.png");
> jugar2 = loadImage ("jugar2.png");
>
>
> cat = new Gato [numgato];
> for (int c = 0; c<numgato; c++) {
> cat[c] = new Gato (random(width), random(height));
> }
>
> man = new Taco (random(width), random(height));
> }
>
> void draw () {
> println (ganar);
> println (game);
>
>
> background (fondo);
> //smooth ();
>
> if (game == false) {
> ganar = false;
> image (title, 500, 350);
> image (catintro, 470, 340);
> image (taco, 540, 340);
> image (instruccion, 500, 380);
> image (jugar, 500, 580);
> //reiniciar();
> } else {
> if (ganar == false) {
> iniciar();
> }
> if (ganar == true) {
> man.encontrado();
> }
> }
>
>
> for (int c=0; c<numgato; c++) {
> if (mousePressed == true) {
> if ( (mouseX < (cat[c].xpos + kitty.width/2)) && (mouseX > (cat[c].xpos - kitty.width/2)) && (mouseY < cat[c].ypos + kitty.height/2) && (mouseY > (cat[c].ypos-kitty.height/2))) {
> cat[c].drag();
> }
> }
> }
> }
>
> void mouseReleased () { //intro title before playing, click boton to play
> if (game == false) {
> if ((mouseX > 400) && (mouseX < 600) && (mouseY > 540) && (mouseY < 620)) {
> game = true;
> }
> }
> if (game == true) {
> if ( (mouseX < (man.xpos + tacoman.width/2)) && (mouseX > (man.xpos - tacoman.width/2)) && (mouseY < (man.ypos + tacoman.height/2)) && (mouseY > (man.ypos-tacoman.height/2))) {
> man.encontrado();
> ganar = true;
> }
> }
>
> if ((ganar == true) && (game == true)) {
> if ((mouseX > 400) && (mouseX < 600) && (mouseY < 590) && (mouseY > 510)) {
> reiniciar();
> }
> }
> }
>
>
>
> void iniciar () {
> // boolean game = true;
>
> image (fondo, 500, 350);
> man.move();
> man.dibujar();
>
> xpos = xpos + 5;
>
> for (int c = 0; c < numgato; c++) {
> cat[c].move();
> cat[c].dibujar();
> }
> }
>
>
> void reiniciar() {
> game = true;
> ganar = false;
>
> for (int c = 0; c < numgato; c++) {
> cat[c].move();
> cat[c].dibujar();
> cat[c].xpos = random (width);
> cat[c].ypos = random (height);
> }
>
> man.move();
> man.dibujar();
> man.xpos = random (width);
> man.ypos = random (height);
> xpos = xpos + 5;
> }
>
>
> class Gato { //class gato
> float xpos, ypos;
> float xspeed;
> float xdirection = 1;
>
> Gato (float px, float py) {
> xpos = px;
> ypos = py;
> }
>
> void move() {
> xspeed = random (2, 7);
> xpos = xpos + (xspeed * xdirection);
>
> if (xpos > 1100) {
> xpos = -100;
> xspeed = xspeed + random (-3, 5);
> }
> }
>
> void dibujar() {
> image (kitty, xpos, ypos);
> }
>
> void drag () {
> xpos = mouseX;
> ypos = mouseY;
> }
> }
>
> class Taco { // class taco
> float xpos, ypos;
> PImage tacoman = loadImage ("taco juego.png");
>
> Taco (float px, float py) {
> xpos = px;
> ypos = py;
> }
>
> void move () {
> xpos = xpos + (random(5, 10)) ;
> if (xpos > 1100) {
> xpos = -80;
> }
> }
>
> void dibujar () {
> image (tacoman, xpos, ypos);
> }
void encontrado () {
ganar = true;
image (gano, 500, 350);
image (jugar2, 500, 550);
}
}