Annonce

>>> Bienvenue sur codelab! >>> Première visite ? >>> quelques mots sur codelab //// une carte des membres//// (apéros) codelab


#1 2015-06-08 18:04:39 java.lang.NullPointerException. APDE

Blivion
nouveau membre
Lieu: Landerneau
Date d'inscription: 2015-06-08
Messages: 4
Site web

java.lang.NullPointerException. APDE



Bonjour,
Je suis en train de porter un jeu que j'avais fais sur calculette ( ...) , et j'ai une erreur qui m'empêche d'avancer à la compilation :Initializing build sequence...
Target: debug
Deleted old build folder
mkdir failed: EEXIST (File exists) path = /data/data/com.calsignlabs.apde/files/tmp
Pre-processing...
Injected log broadcaster
java.lang.NullPointerException
    at com.calsignlabs.apde.build.Build.preprocess(Build.java:1383)
    at com.calsignlabs.apde.build.Build.build(Build.java:452)
    at com.calsignlabs.apde.EditorActivity$22.run(EditorActivity.java:2295)
    at java.lang.Thread.run(Thread.java:841)
mkdir failed: EEXIST (File exists) path = /data/data/com.calsignlabs.apde/app_processing_home

Le code :

int i, up, down, left, right, Y, X;
float J, K, T;
PImage obj1;
void setup()
{
  obj1=loadImage(mur.jpg");
    size(displayWidth, displayHeight, P3D);
    K=3;
    J=2;
    T=3.63;
  }
  void draw() { 
    background(0);
    scadre();
    optouch();
    fcadre();
    d3line();
    walltex();
    ctouch();
  
    cursor();
  }
  
  void scadre()
  {
    stroke(0, 255, 0);
    line(0, 0, displayWidth, 0);
    line(0, 0, 0, displayHeight);
    line(0, displayHeight, displayWidth, displayHeight);
    line(displayWidth, 0, displayWidth, displayHeight);
  }
  
  void ctouch()
  { 
    int Xmouse= mouseX, Ymouse=mouseY;
    stroke(0, 255, 0);
    if (Xmouse <90 & Xmouse >0 & Ymouse>displayHeight-150 & Ymouse < displayHeight-60  ) {
      fill(125, 125, 0);
      rect(0, displayHeight-150, 90, 60);
      left=1;
    } else {
      fill(255, 255, 0); 
      rect(0, displayHeight-150, 90, 60);
      left=0;
    }
    if (Xmouse > 150 & Xmouse < 240 & Ymouse > displayHeight-150 & Ymouse < displayHeight-60)
    {
      fill(125, 125, 0);
      rect(150, displayHeight-150, 90, 60);
      right=1;
    } else {
      fill(255, 255, 0);
      rect(150, displayHeight-150, 90, 60);
      right=0;
    }
    if (Xmouse > 90 & Xmouse < 150 & Ymouse > displayHeight-90 & Ymouse < displayHeight )
    {
      fill(125, 125, 0);
      rect(90, displayHeight, 60, -90);
      down=1;
    } else {
      fill(255, 255, 0);
      rect(90, displayHeight, 60, -90);
      down=0;
    }
    if (Xmouse > 90 & Xmouse < 150 & Ymouse > displayHeight-240 & Ymouse < displayHeight-150)
    {
      fill(125, 125, 0);
      rect(90, displayHeight-150, 60, -90);
      up=1;
    } else {
      fill(255, 255, 0);
      rect(90, displayHeight-150, 60, -90);
      up=0;
    }
  }
  
  void fcadre()
  { 
    stroke(0, 255, 0);
    line(displayWidth/K+X, displayHeight/K+Y, displayWidth/K*J+X, displayHeight/K+Y);
    line(displayWidth/K+X, displayHeight/K+Y, displayWidth/K+X, displayHeight/K*J+Y);
    line(displayWidth/K+X, displayHeight/K*J+Y, displayWidth/K*J+X, displayHeight/K*J+Y);
    line(displayWidth/K*J+X, displayHeight/K+Y, displayWidth/K*J+X, displayHeight/K*J+Y);
  }
  void cursor()
  {
    stroke(255, 0, 0);
    line(displayWidth/2-10, displayHeight/2-10, displayWidth/2+10, displayHeight/2-10);
    line(displayWidth/2-10, displayHeight/2+10, displayWidth/2+10, displayHeight/2+10);
    line(displayWidth/2-10, displayHeight/2-10, displayWidth/2-10, displayHeight/2+10);
    line(displayWidth/2+10, displayHeight/2-10, displayWidth/2+10, displayHeight/2+10);
    line(displayWidth/2-2, displayHeight/2, displayWidth/2+2, displayHeight/2);
    line(displayWidth/2, displayHeight/2-2, displayWidth/2, displayHeight/2+2);
  }
  void d3line()
  {
    line(0, 0, displayWidth/K+X, displayHeight/K+Y);
    line(0, displayHeight, displayWidth/K+X, displayHeight/K*J+Y);
    line(displayWidth, 0, displayWidth/K*J+X, displayHeight/K+Y);
    line(displayWidth, displayHeight, displayWidth/K*J+X, displayHeight/K*J+Y);
  }
  void optouch()
  {
    if (left==1) {
      X=X+1;
    }
    if (right==1) {
      X=X-1;
    }
    if (up==1) {
      K=K+0.01;
      J=J+0.01;
    }
    if (down==1 & K>0) {
      K=K-0.01;
      J=J-0.01;
    }
}
  void walltex() {
    rotateY(radians(90));
    image(obj1,0,0, T*displayWidth/K+X,displayHeight);
   rotateY(radians(180));
    image(obj1,displayWidth,0,-1*displayWidth/K+X,displayHeight);
    rotateY(radians(-270));
  }

J'utilise l'application APDE pour compiler directement sur ma tablette,  j'ai peut être supprimer du code par erreur.
Merci de votre aide, cordialement Blivion

Hors ligne

 

#2 2015-06-08 18:23:37 Re : java.lang.NullPointerException. APDE

Mushussu
membre
Lieu: Orléans
Date d'inscription: 2012-05-24
Messages: 802

Re: java.lang.NullPointerException. APDE



C'est ta ligne :

obj1=loadImage("mur.jpg");

Hors ligne

 

fil rss de cette discussion : rss

Pied de page des forums

Powered by FluxBB

codelab, graphisme & code : emoc / 2008-2024