error with my execution (fisica NoSuchMethodError)

edited December 2015 in Library Questions

hi guys please i need help, i am actully workng a monoploy game development and i have everything set but I have this error message while I run the application:

Using this database: C:\Users\-\Desktop\Processing\-\data\-.db
Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: org.jbox2d.dynamics.World.<init>(Lorg/jbox2d/collision/AABB;Lorg/jbox2d/common/Vec2;Z)V
    at fisica.FWorld.<init>(Unknown Source)
    at fisica.FWorld.<init>(Unknown Source)
    at sheergrace.setup(sheergrace.java:203)
    at processing.core.PApplet.handleDraw(PApplet.java:2281)
    at processing.opengl.PJOGL$PGLListener.display(PJOGL.java:799)
    at jogamp.opengl.GLDrawableHelper.displayImpl(GLDrawableHelper.java:590)
    at jogamp.opengl.GLDrawableHelper.display(GLDrawableHelper.java:574)
    at javax.media.opengl.awt.GLCanvas$9.run(GLCanvas.java:1218)
    at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1036)
    at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:911)
    at javax.media.opengl.awt.GLCanvas$10.run(GLCanvas.java:1229)
    at javax.media.opengl.Threading.invoke(Threading.java:193)
    at javax.media.opengl.awt.GLCanvas.display(GLCanvas.java:492)
    at javax.media.opengl.awt.GLCanvas.paint(GLCanvas.java:546)
    at sun.awt.RepaintArea.paintComponent(Unknown Source)
    at sun.awt.RepaintArea.paint(Unknown Source)
    at sun.awt.windows.WComponentPeer.handleEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Already called beginDraw()
Using this database: C:\Users\-\Desktop\Processing\-\data\-.db
TuioClient: failed to connect to port 3333
java.lang.NullPointerException
    at processing.mode.java.runner.Runner.findException(Runner.java:926)
    at processing.mode.java.runner.Runner.reportException(Runner.java:871)
    at processing.mode.java.runner.Runner.exceptionEvent(Runner.java:797)
    at processing.mode.java.runner.Runner$2.run(Runner.java:686)

Answers

  • Just interesting, why you need Fisica for a monopoly game?

  • Ater what do you think?

  • edited December 2015

    Maybe you can show a part of code where you get this error? Do you use Processing 3?

  • am using 2.1 and this error pops up while I try to run

    //Import Libraries import TUIO.*; import ddf.minim.*; import gifAnimation.*; import ddf.minim.signals.*; import ddf.minim.analysis.*; import ddf.minim.effects.*; import fisica.*; import processing.opengl.*; import java.util.*; //Create instances of the objects imported; Minim minim; SQLite db; AudioPlayer sound; WaveformRenderer waveform; FWorld world; String msg = ""; PFont font; HashMap symbols=new HashMap(); PFont f; PFont Bf; PFont BfB; TuioProcessing tuioClient; int GAME_STATE, qInc, scorePoint, screenID; HashMap<String, Integer> gameSettings; boolean timerIsset = false; boolean isPaused = false; boolean isStarted = false; boolean dummy = false, inPlay = false;

    int highscore;

    Timmer countDown, pauseMoment;

    int introTimer, checkStatus, countPlay, freezeMoment, onQuestion, currentP1LocationX, currentP1LocationY;

    int[] playerOneMarkers = { p1puzzlepiece1,p1puzzlepiece2,p1puzzlepiece3,p1puzzlepiece4}; int[] playerTwoMarkers = { p2puzzlepiece1,p2puzzlepiece2,p2puzzlepiece3,p2puzzlepiece4};

    PImage[] qLvl1 = new PImage[3]; PImage[] qLvl2 = new PImage[5]; PImage highscoreimg;

    PImage lvlBg, intro, intro2, intro3, selectPlayers, menuBg, puzzBg; int[] qP1Ans = {164,213,30}; int[] qP2Ans = {210,205,167};

    int[] qLvl2Ans = {4,3,11,10,1};

    int[] qTaken = new int[0];

    final static short p1puzzlepiece1 = 1; //192; final static short p1puzzlepiece2 = 2; //193; final static short p1puzzlepiece3 = 3; //199; final static short p1puzzlepiece4 = 4; //198;

    final static short p2puzzlepiece1 = 12; final static short p2puzzlepiece2 = 22; final static short p2puzzlepiece3 = 32; final static short p2puzzlepiece4 = 42;

    int GAME_X = 800; int GAME_Y = 600;

    PImage[] images = new PImage[4];

    boolean[] monitor = {false,false,false,false}; cuadro piezas[]; int dragged_item,grid_x=532,grid_y=350; boolean config_inicial, soundPlay=false; float offset;

    boolean donateMode = false; String scoreFile[]; int spot=0, i=0, q=0, a, newScore, right, mode, _players, playerTurn2, id, turn=0, movesMade=0, nextPlayer=0;
    int x=-10, y=-10; //for initial hiding of icons //float countdown=0, timer=0; boolean winner = false, play = false, timeUp=false; String lastInput = new String(); String currentInput = new String(); String statusIcon,question, theAnswer, address, answerSupplied, newName, statusMessage=""; Player player1, player2, player3, player4; boolean show_money = false; float controlAngle; int selection, selection_money, angleTimer = 0, showTime, choice=0, stage=0; String spotName =""; String[]playerName; String[] questionLoader; String[] fullquestion; String[]playerIcon; int[]where; int[]money; int owed = 100; String comment = ", its your turn to show your batch "; String money_comment =""; String[]position; Gif anim_bg1; Gif loading; int actualLevel; int playturn; String cImage_1; int start=0,stop; int track1=1, track2=1; int borrowed = 0, curmoney=0; float level; int levetTime=0, moneyMode=0, checkmoney = 0; PImage slider; float sliderPosX,sliderPosY; int count=1,count2=1,count3=1; float handX=-5000,handY=-5000; float handX1=-5000,handY1=-5000; float handX2=-5000,handY2=-5000; boolean show_comment; int doSpot = 0;

    Menu tool; Timer timer;

    void setup(){ symbols.put(0, "0"); symbols.put(1, "1"); symbols.put(2, "2"); symbols.put(3, "3"); symbols.put(4, "4"); symbols.put(5, "5"); symbols.put(6, "6");

      symbols.put(36, "36");
      symbols.put(28, "28");//"GO for P1
      symbols.put(73, "73");//"GO for P2
      symbols.put(15, "15");//"GO for P3
      symbols.put(16, "16");//"GO for P4
    
      money = new int[4];
      money[0] = 1500;
      money[1] = 1500;
      money[2] = 1500;
      money[3] = 1500;   
    
    
     size (1022,763, P3D);
     fill(0);
     smooth();
     f = createFont("ArialRoundedMTBold", 48, true);
     Bf = loadFont("Andalus-48.vlw");
     BfB = loadFont("BookmanOldStyle-48.vlw");
     textFont(f,24);
     mode = 0;
     db = new SQLite(this, "flacisland.db");
     waveform = new WaveformRenderer();
     tuioClient  = new TuioProcessing(this);  
     //background(loadImage("splashscreen.png"));
     //fs = new FullScreen (this);
     //fs.enter();
    
      Fisica.init(this);
      font = loadFont("ArialRoundedMTBold-48.vlw");
      textFont(font, 40);
    
      world = new FWorld();
      world.setEdges(this, color(100));
      world.remove(world.top);
      world.setGravity(0, 500);
    
      Texto t = new Texto("SLIDE THE ARROW TO START THE GAME");
      t.setPosition(width/2, height/2);
      t.setRotation(random(-1, 1));
      t.setFill(255);
      t.setNoStroke();
      t.setRestitution(0.75);
      world.add(t); 
    
     show_comment = true;
     minim = new Minim(this);
     tool = new Menu();
     timer = new Timer(350, 80, 790, 100);
     tool.setBackGd("splashscreen.png");
     sliderPosX=390;
      sliderPosY=520;
     tool.setAudio(true);
     loading = new Gif(this, "loadingAnimation.gif"); 
     anim_bg1 = new Gif(this, "Intro_ANIM_RADAR.gif");
     actualLevel=0;
     audios("Boring.mp3"); 
     //sound = minim.loadFile("theme.mp3");
    
    
    
       screenID = 0;
    

    gameSettings = new HashMap<String, Integer>(); GAME_STATE = 3; //gameSettings.put("levelOn", 1); countPlay = 0; qInc = 0; scorePoint = 20; freezeMoment = 0;

    onQuestion = 1;

    gameSettings.put("levelOneSec", 15); gameSettings.put("levelTwoSec", 30); gameSettings.put("levelThreeSec", 30);

    gameSettings.put("questionTimeUp", 0); // 1 = true 0 = false gameSettings.put("playerNo", 1); // 1 - single player 2 - multi-player gameSettings.put("mode", 0); // Mode determines if answer marker is required or not gameSettings.put("levelOn", 1); // 0 = false 1 = true gameSettings.put("currentLevel", 1); // By default Level 1

    gameSettings.put("playerOneScore", 0); gameSettings.put("playerTwoScore", 0); //textFont(mario); checkStatus = 200;

    }

    void draw() {

    if(mode== 0)
    

    { tool.display(); tool.components(); } if(mode == 0) { world.step(); world.draw(this); }

    if(tool.getLevel()== 1) { background (loadImage("players.png")); fill(255);

    //timer.DisplayTime();
    //println(selection);
          smooth();
        if (selection == 2)
        {
          background(loadImage("couple1.png"));
            timer.DisplayControl();
            fill(59, 182, 92);
            text("You have selected "+selection +" Players. ", 390, 450); 
           text(""+selection, 530,395); 
    
        }
    
        if (selection == 3)
        {
           background(loadImage("couple2.png"));
            timer.DisplayControl();
            fill(59, 182, 92);
           text("You have selected "+selection +" Players.", 390, 450); 
           text(""+selection, 530,395);
    
        }
        if (selection == 4)
        {
            background(loadImage("couple3.png"));
            timer.DisplayControl();
            fill(59, 182, 92);
           text("You have selected "+selection +" Players.", 390, 450); 
          text(""+selection, 530,395); 
    
        }
    

    }

    if (mode==2) { if (q<_players) {

          textFont(f,28);
          background (loadImage("playername.png"));
          fill(255);
          smooth();
          text ("Player " +(q+1), 320, 482);
          text (currentInput, 470, 482);
          fill(0);
      }
      else 
      {
          mode =3;    
          playGame();
      }
    

    }

    if (mode==4 || mode ==5) { textFont(f,20); background (loadImage("Board"+_players+".png")); if(show_money == true) { text(""+borrowed, 225, 505); spotName= "Charity"; timer.DisplayMoneyControl(); } for (i=0;i<_players;i++) { fill(230, 32, 51); smooth(); text (playerName[i], (190+i*200), 135); image(loadImage(playerIcon[i]), (150+(i*190)), 110); text (money[i], (220+i*190), 160); }

         //text (playerName[nextPlayer]+", You have made  "+movesMade+"  moves", 280, 330); 
    
        if(turn == 0 || turn == 1){ image(loadImage(statusIcon), 220, 170);}
        else if(turn == 2){ image(loadImage(statusIcon), 420, 170);}
        else if(turn == 3){ image(loadImage(statusIcon), 610, 170);}
        else if(turn == 4){ image(loadImage(statusIcon), 880, 170);}
    
        if(show_comment == true){
         textSize(20);
         smooth();
         fill(8,192,26); 
         text ("Hello "+playerName[nextPlayer]+ comment, 190, 220); 
         }
    
         textFont(BfB);
         textSize(20);
         fill(255, 0 , 0);
         text(money_comment, 150, 450);
         text("Remember to show your batch before tossing the dice", 600, 800);
        // text("Your now on "+spotName, 300, 360);
    
    
         if (_players==2) 
         {
           if (where[0]!=0)player1.move(where[0],0);
           if (where[1]!=0)player2.move(where[1],1);
         }
         if (_players==3)
         {
           if (where[0]!=0)player1.move(where[0],0);
           if (where[1]!=0)player2.move(where[1],1);
           if (where[2]!=0)player3.move(where[2],2);
         }
         if (where[0]!=0 && _players==4)
         {
           if (where[0]!=0)player1.move(where[0],0);
           if (where[1]!=0)player2.move(where[1],1);
           if (where[2]!=0)player3.move(where[2],2);
           if (where[3]!=0)player4.move(where[3],3);
         }
    
         textFont(Bf);
         textSize(30);
         smooth();
         fill(#FF0000);
         text (statusMessage + spotName, 180, 260);
    

    }

    if(mode == 6) { //Load questions heres

      image(loadImage("question.gif"), 200, 200);
    
      textFont(f,20);
      fill(0);
      text(fullquestion[0] ,240,320);    
      text(" "+fullquestion[1],272,366);
      text(" "+fullquestion[2],590,366);
      text(" "+fullquestion[3],272,400);
      text(" "+fullquestion[4],590,400);
    
      timer.DisplayQuestionTime();
    
      if (right==1)
      image(loadImage("right.png"), 502, 380);
    
      if (right==2)
      image(loadImage("wrong.png"), 510, 390);
    

    }

    if(mode == 10){

    if( inPlay == false ) { inPlay = true; piezas = new cuadro[4]; images[0] = loadImage("puzzle/p2.png"); images[1] = loadImage("puzzle/p1.png"); images[2] = loadImage("puzzle/p4.png"); images[3] = loadImage("puzzle/p3.png");

          puzzBg = loadImage("puzzle/lvl3Bg.png");
    
          config_inicial = true;
          dragged_item = -1;
          gameSettings.put("currentLevel", 3);
          timerIsset = false;
    
        } else
        {
          levelThree();
    
          Vector<TuioObject> tuioObjectList =tuioClient.getTuioObjects();
          for (TuioObject tobj:tuioObjectList)
          {
    
                 currentP1LocationX = tobj.getScreenX(width);
                 currentP1LocationY = tobj.getScreenY(height);
    
                 switch( tobj.getSymbolID() )
                 {
                   case p2puzzlepiece1:
                   case p1puzzlepiece1:
                     dragged_item = 0;
                   break;
                   case p2puzzlepiece2:
                   case p1puzzlepiece2:
                     dragged_item = 1;
                   break;
                   case p2puzzlepiece3:
                   case p1puzzlepiece3:
                     dragged_item = 2;
                   break;
                   case p2puzzlepiece4:
                   case p1puzzlepiece4:
                     dragged_item = 3;
                   break;
                 }
    
    
                  switch( tobj.getSymbolID() )
                  {
                     case p2puzzlepiece1:
                     case p1puzzlepiece1:
                     case p2puzzlepiece2:
                     case p1puzzlepiece2:
                     case p2puzzlepiece3:
                     case p1puzzlepiece3:
                     case p2puzzlepiece4:
                     case p1puzzlepiece4:
    
                        int xxx[] = {91,59,91,91};
                        int yyy[] = {91,91,91,59};                       
    
                        for(int i=0; i<4; i++)
                        {
    
                          if( monitor[i] == false && dragged_item==i || (dragged_item==-1 && piezas[i].over(currentP1LocationX,currentP1LocationY) ))
                          {
                            dragged_item = i;
                           // piezas[i].x1 = currentP1LocationX - xxx[i];
                           // piezas[i].y1 = currentP1LocationY - yyy[i];
                           // piezas[i].x2 = currentP1LocationX + xxx[i];
                           // piezas[i].y2 = currentP1LocationY + yyy[i];
                            break;
                          }
    
                        } 
    
                    break;
                  }
    
            }          
    
        }
    

    }

    }

  • void activate() { if(mode == 0) { if(id == 1) instruction(); // if(id == 36) gameHome(); if(id == 5) exit(); }

    if (mode==1) { tool.setLevel(4); timer.stop(); _players= selection; playerSettings(); }

    if(checkmoney== 1) {

    if(moneyMode == 0)
    {
    setDebitMoney(0, borrowed);
    }
    
    if(moneyMode == 1 )
    {
    setDebitMoney(1, borrowed);
    }
    
    if(moneyMode == 2)
    {
    setDebitMoney(2, borrowed);
    }
    
    if(moneyMode == 3)
    {
    setDebitMoney(3, borrowed);
    }
    

    // int fina = curmoney - borrowed; // money[playturn] = fina; money_comment ="Thank you for your donation.";

    show_comment = true;
    

    show_money=false; //println(fina); timer.stop(); mode = 5; checkmoney= 0; }

    if (mode==4) {

      if (_players==2 && play==true)
      {
          if (turn==1 && id>0 && id<7)
          {
            if ((where[0]+id) > 36) id=0;
            where[0] = where[0] + id;
            movesMade = movesMade +1;
            //statusMessage=playerName[0]+" moved "+id+" places. Now on spot "+where[0];spotName
            statusMessage=playerName[0]+" move "+id+" places. Your now on ";
            checkSpot(0);
            nextPlayer=1; rollDice();
    
          }
          if (turn==2 && id>0 && id<7)
          {
            if ((where[1]+id) > 28) id=0;
            where[1] = where[1] + id;
            statusMessage=playerName[1]+" move "+id+" places. Your now on ";
            checkSpot(1); 
            turn=0; nextPlayer=0; rollDice();
    
          }
      }
    
      if (_players==3 && play==true)
      {
          if (turn==1 && id>0 && id<7)
          {
            if ((where[0]+id) > 28) id=0;
            where[0] = where[0] + id;
            movesMade = movesMade +1;
            statusMessage=playerName[0]+" move "+id+" places. Your now on ";
            checkSpot(0);
            nextPlayer=1; rollDice();
    
          }
          if (turn==2 && id>0 && id<7)
          {
            if ((where[1]+id) > 28) id=0;
            where[1] = where[1] + id;
            statusMessage=playerName[1]+" move "+id+" places. Your now on ";
            checkSpot(1); 
            nextPlayer=2; rollDice();
    
          }
          if (turn==3 && id>0 && id<7)
          {
            if ((where[2]+id) > 28) id=0;
            where[2] = where[2] + id;
            statusMessage=playerName[2]+" moved "+id+" places. Your now on ";
            checkSpot(2); 
            mode = 5;
            turn=0; nextPlayer=0; rollDice();
    
          }
      }
    
      if (_players==4 && play==true)
      {
          if (turn==1 && id>0 && id<7)
          {
            if ((where[0]+id) > 28) id=0;
            where[0] = where[0] + id;
            movesMade = movesMade +1;
            statusMessage=playerName[0]+" move "+id+" places. Your now on ";
            checkSpot(0); 
            mode = 5;
            nextPlayer=1; rollDice();
    
          }
          if (turn==2 && id>0 && id<7)
          {
            if ((where[1]+id) > 28) id=0;
            where[1] = where[1] + id;
            statusMessage=playerName[1]+" moved "+id+" places. Your now on ";
            checkSpot(1); 
            mode = 5;
            nextPlayer=2; rollDice();
    
          }
          if (turn==3 && id>0 && id<7)
          {
            if ((where[2]+id) > 28) id=0;
            where[2] = where[2] + id;
            statusMessage=playerName[2]+" moved "+id+" places. Your now on ";
            checkSpot(2);
           mode = 5;
           nextPlayer=3; rollDice();
    
          }
          if (turn==4 && id>0 && id<7)
          {
            if ((where[3]+id) > 28) id=0;
            where[3] = where[3] + id;
            statusMessage=playerName[3]+" moved "+id+" places. Your now on ";
            checkSpot(3); 
           mode = 5;
           turn=0; nextPlayer=0; rollDice();
    
          }
      }
    

    }

    if (mode==5) { if (turn==0){if (id==28){turn=1;mode=4; play=true; statusIcon= "go.png"; comment = ", Thank you for showing your batch. You can now toss your dice!" ;}} if (turn==1){if (id==73){turn=2;mode=4; play=true; statusIcon= "go.png"; comment = ", Thank you for showing your batch. You can now toss your dice!" ;}} if (turn==2){if (id==15){turn=3;mode=4; play=true; statusIcon= "go.png"; comment = ", Thank you for showing your batch. You can now toss your dice!" ;}} if (turn==3){if (id==16){turn=4;mode=4; play=true; statusIcon= "go.png"; comment = ", Thank you for showing your batch. You can now toss your dice!" ;}}

    }

    if (mode==6 && timeUp==false) { if(id>0 && id<5) { checkAnswer(); } }

    }

    void audios(String music){ if(count==1 && tool.getAudio()==true) { sound = minim.loadFile(""+music+"", 2048); sound.addListener(waveform); sound.play(); count+=1; } }

    void checkSpot(int playerTurn) { playerTurn2=playerTurn;

    if (where[playerTurn]==4 || where[playerTurn]==15 || where[playerTurn]==27) { timer.start(); if (db.connect()) {
    db.query( "SELECT * FROM sl WHERE number = 3 ORDER BY RANDOM( ) LIMIT 1" ); question = db.getString("question")+"|"+db.getString("optionA")+"|"+db.getString("optionB")+"|"+db.getString("optionC")+"|"+db.getString("optionD")+"|"+db.getString("answer"); }

      fullquestion = split(question, '|');
      theAnswer = fullquestion[5];
      id=0; right=0;  mode=6;
    

    } else if(where[playerTurn]==2 || where[playerTurn]==10 || where[playerTurn]==17 || where[playerTurn]==26) { textFont(BfB); textSize(20); fill(255, 0, 0); money_comment = "OOps!, "+playerName[nextPlayer]+ " Save a child in africa, please donate!"; println(money_comment); show_comment = false; donateMode = true; mode = 5;

    } else if(where[playerTurn]== 7 || where[playerTurn]== 21) { spotName =""; statusMessage = playerName[nextPlayer]+ " you got yourself into Jail.!";

    if(turn == 0 || turn == 1)
    {
    setDebitMoney(0, 200);
    }
    
    if(turn == 2 )
    {
    setDebitMoney(1, 200);
    }
    
    if(turn == 3)
    {
    setDebitMoney(2, 200);
    }
    
    if(turn == 4)
    {
    setDebitMoney(3, 200);
    }
    
    
    println("Your a dead man");
    mode = 5;
    

    } else if(where[playerTurn]==5 || where[playerTurn]==14 || where[playerTurn]==21) { println("Pay for your school bus ride home"); // mode = 10; money_comment = playerName[nextPlayer]+ " We hope you enjoy your ride!"; spotName ="";

    if(turn == 0 || turn == 1)
    {
    setDebitMoney(0, 100);
    }
    
    if(turn == 2 )
    {
    setDebitMoney(1, 100);
    }
    
    if(turn == 3)
    {
    setDebitMoney(2, 100);
    }
    
    if(turn == 4)
    {
    setDebitMoney(3, 100);
    }
    mode = 5;
    

    } else if(where[playerTurn]==19 || where[playerTurn]==28 ) { mode = 10; println("Initiate the puzzle game"); } else if(where[playerTurn]==1 ||where[playerTurn]==3 || where[playerTurn]==6 || where[playerTurn]==8 || where[playerTurn]==9 || where[playerTurn]==11 || where[playerTurn]==12 || where[playerTurn]==13 || where[playerTurn]==16 || where[playerTurn]==18 || where[playerTurn]==20 || where[playerTurn]==23 || where[playerTurn]==24 || where[playerTurn]==25) { if(turn == 0 || turn == 1) { setDebitMoney(0, 50); }

    if(turn == 2 )
    {
    setDebitMoney(1, 50);
    }
    
    if(turn == 3)
    {
    setDebitMoney(2, 50);
    }
    
    if(turn == 4)
    {
    setDebitMoney(3, 50);
    }
    mode = 5;
    

    } else if(where[playerTurn]==29) { println("GO!! Go!! GO!!"); mode = 5; } else { mode = 5; } }

    void rollDice() { play = false; comment = ", its your turn to show your batch "; statusIcon = "stop.png"; if (_players==2) { if(where[0]>=where[1]) { position[0]=playerName[0];position[1]=playerName[1]; } else { position[0]=playerName[1];position[1]=playerName[0]; } }

    if (_players==3) { if(where[0]>=where[1]) {
    if (where[0]>=where[2]) { position[0]=playerName[0];

          if(where[1]>=where[2])
          {
            position[1]=playerName[1];position[2]=playerName[2];
          }
          else
          {
            position[2]=playerName[1];
            position[1]=playerName[2];
          }
        }
    
        else
        {
          position[0]=playerName[2];
          position[1]=playerName[0];
          position[2]=playerName[1];
        }
    

    } else { if(where[1]>=where[2]) { position[0]=playerName[1]; if (where[2]>=where[0]) { position[1]=playerName[2]; position[2]=playerName[0]; } else { position[1]=playerName[0]; position[2]=playerName[2]; } } else { position[0]=playerName[2]; position[1]=playerName[1]; position[2]=playerName[0]; } }

    } if (_players==4) { int w=where[0], x = where[1],y= where[2], z=where[3]; int [] sortList={w,x,y,z}; sortList = sort(sortList); sortList = reverse(sortList); for(i=0;i<4;i++) { if(sortList[i]==w)position[i]=playerName[0]; if(sortList[i]==x)position[i]=playerName[1]; if(sortList[i]==y)position[i]=playerName[2]; if(sortList[i]==z)position[i]=playerName[3]; } } }

    void instruction() { background (loadImage("instruction.gif")); } void gameHome() { mode = 1; background (loadImage("players.png")); }

    void playGame() { background (loadImage("Board"+_players+".png")); // sound.close(); mode = 5; rollDice(); }

    void playerSettings() { playerName = new String [_players]; playerIcon = new String [_players]; where = new int [_players]; position = new String [_players];

    for (i=0;i<_players;i++) { playerIcon[i]="image"+i+".png"; }

    mode = 2;

    if (_players==2) { player1= new Player(playerName[0],playerIcon[0], 0, 0); player2= new Player(playerName[1],playerIcon[1], 0, 0); } if (_players==3) { player1= new Player(playerName[0],playerIcon[0], 0, 0); player2= new Player(playerName[1],playerIcon[1], 0, 0); player3= new Player(playerName[2],playerIcon[2], 0, 0); } if (_players==4) { player1= new Player(playerName[0],playerIcon[0], 0, 0); player2= new Player(playerName[1],playerIcon[1], 0, 0); player3= new Player(playerName[2],playerIcon[2], 0, 0); player4= new Player(playerName[3],playerIcon[3], 0, 0); } }

    void highScore(String bgImage) { background (loadImage(bgImage)); scoreFile=loadStrings("highscores.txt"); for(int i=0; i<5; i++) { fill(255); text(scoreFile[i+5], 480, 550+(i42)); text(scoreFile[i]+ " RS", 570, 550+(i42)); fill(0); } }

    void keyPressed() { if (mode==2) { if (q<_players) { if(key == ENTER) { playerName[q]= currentInput; position[q]=playerName[q]; //just assigning default positions to each player in the order the enter thier names currentInput=""; q++; }

              if(key == BACKSPACE && currentInput.length() > 0)
              {
                currentInput = currentInput.substring(0, currentInput.length() - 1);
              }
    
              if(key == CODED) 
              {
               // ignore...
              }
              if(currentInput.length()==1 && currentInput.charAt(0)==ENTER)
              {
                currentInput = currentInput.substring(0, currentInput.length() - 1);
              }
              else
              {
                currentInput = currentInput + key;
              }
        }
        else
        {
          mode =3;    
          playGame();
        }
    

    } }

    public int getMoney(int playa) { int moneyy = money[playa]; return moneyy; }

    public void setDebitMoney(int playa, int moneys) { int moneyy = money[playa]; int reserve = moneyy - moneys; money[playa] = reserve; }

    public void creditMoney(int playa, int moneys) { int moneyy = money[playa]; int reserve = moneyy + moneys; money[playa] = reserve; }

    void addTuioObject(TuioObject tobj){ id = tobj.getSymbolID(); if (symbols.containsKey(id))activate(); } void removeTuioObject(TuioObject tobj){ if(tobj.getSymbolID()==0) { handX=-5000; handY=-5000; }

    if(tobj.getSymbolID()== 38) { show_money = false; println("iIts working"); }

    if( GAME_STATE == 3 && mode == 10) { puzzleReleased( tobj.getSymbolID() ); }

    } void updateTuioObject (TuioObject tobj) {

    if(tool.getLevel()==0) { handX=tobj.getScreenX(width)-50; handY=tobj.getScreenY(height); if(tobj.getSymbolID()==0) { if(tobj.getScreenX(width)-50>588) { sliderPosX=585; tool.setLevel(0.5); } else if(tobj.getScreenX(width)-50<350) { sliderPosX=350; } else { sliderPosX=tobj.getScreenX(width)-50; } if((tobj.getScreenX(width)-50>=0 && tobj.getScreenX(width)-50<=105) && (tobj.getScreenY(height)>=550 && tobj.getScreenY(height)<=680)) { tool.setLevel(0.8); } } }

    controlAngle = tobj.getAngleDegrees(); if ((id==7) && (controlAngle > 0 && controlAngle <=120)) { if(tool.getLevel()==1) { selection = 4;

      timer.start();
      } 
    

    }

    if ((id==7) && (controlAngle > 120 && controlAngle <=210)) { if(tool.getLevel()==1) { selection = 3;

        timer.start(); 
      }
    

    }

    if ((id==7) && (controlAngle > 210 && controlAngle <=310))
    

    { if(tool.getLevel()==1) { selection = 2;

        timer.start(); 
      }
    

    }

    //Money for first player if(id == 8 && donateMode == true) { show_money = true; if(controlAngle >0 && controlAngle<= 45) { borrowed = 300; moneyMode =0; timer.start();

          curmoney = getMoney(0);
        }
      if(controlAngle >45 && controlAngle<= 90)
        {
          borrowed = 250;
          moneyMode =0;
          timer.start();
          curmoney = getMoney(0);
        }
    
     if(controlAngle >90 && controlAngle<= 150)
        {
          borrowed = 200;
          moneyMode =0;
           timer.start();
          curmoney = getMoney(0);
        }
     if(controlAngle >150 && controlAngle<= 200)
        {
          borrowed = 150;
          moneyMode =0;
           timer.start();
          curmoney = getMoney(0);
        }
     if(controlAngle >200 && controlAngle<= 280)
        {
          borrowed = 100;
          moneyMode =0;
           timer.start();
           curmoney = getMoney(0);
        }
     if(controlAngle >280 && controlAngle<= 340)
        {
          borrowed = 100;
          moneyMode =0;
          timer.start();
          curmoney = getMoney(0);
        }   
    }
    

    //Money for second player if(id == 9 && donateMode == true) { show_money = true; if(controlAngle >0 && controlAngle<= 45) { borrowed = 300; moneyMode =1; timer.start(); curmoney = getMoney(1); } if(controlAngle >45 && controlAngle<= 90) { borrowed = 250; moneyMode =1; timer.start(); curmoney = getMoney(1); }

     if(controlAngle >90 && controlAngle<= 150)
        {
          borrowed = 200;
          moneyMode =1;
           timer.start();
          curmoney = getMoney(1);
        }
     if(controlAngle >150 && controlAngle<= 200)
        {
          borrowed = 150;
          moneyMode =1;
           timer.start();
          curmoney = getMoney(1);
        }
     if(controlAngle >200 && controlAngle<= 280)
        {
          borrowed = 100;
           timer.start();
           curmoney = getMoney(1);
        }
     if(controlAngle >280 && controlAngle<= 340)
        {
          borrowed = 100;
          moneyMode =1;
          timer.start();
          curmoney = getMoney(1);
        }   
    }
    
    
    //Money for the third player
    
    if(id == 10 && donateMode == true)
    {
      show_money = true;
      if(controlAngle >0 && controlAngle<= 45)
        {
          borrowed = 300;
          moneyMode =2;
          timer.start();
          curmoney = getMoney(2);
        }
      if(controlAngle >45 && controlAngle<= 90)
        {
          borrowed = 250;
          moneyMode =2;
          timer.start();
          curmoney = getMoney(2);
        }
    
     if(controlAngle >90 && controlAngle<= 150)
        {
          borrowed = 200;
           timer.start();
          curmoney = getMoney(2);
        }
     if(controlAngle >150 && controlAngle<= 200)
        {
          borrowed = 150;
          moneyMode =2;
           timer.start();
          curmoney = getMoney(2);
        }
     if(controlAngle >200 && controlAngle<= 280)
        {
          borrowed = 100;
          moneyMode =2;
           timer.start();
           curmoney = getMoney(2);
        }
     if(controlAngle >280 && controlAngle<= 340)
        {
          borrowed = 100;
          moneyMode =2;
          timer.start();
          curmoney = getMoney(2);
        }   
    }
    

    //println(controlAngle); //println(turn); } void addTuioCursor(TuioCursor tcur) { } void updateTuioCursor (TuioCursor tcur) { } void removeTuioCursor(TuioCursor tcur) {

    } void refresh(TuioTime bundleTime) { }

  • That is too big piece of code and not formatted right...

  • edited December 2015

    The code you posted is a waste of time, as Ater said it is too big and not properly formatted for this forum (how to format code). Even then there is no chance of running the code.

    First thing the statement

    size (1022, 763, P3D);

    MUST be the FIRST statement inside setup so I would try that first although I am not convinced it will solve the problem.

    In the stack trace there are 2 things of interest

    Thing 1
    java.lang.NoSuchMethodError: org.jbox2d.dynamics.World.(Lorg/jbox2d/collision/AABB;Lorg/jbox2d/common/Vec2;Z)V at fisica.FWorld.(Unknown Source) at fisica.FWorld.(Unknown Source) at sheergrace.setup(sheergrace.java:203) at processing.core.PApplet.handleDraw(PApplet.java:2281) at ...

    Putting on my Sherlock Holmes hat on and doing a bit of investigating we can reach some conclusions

    at sheergrace.setup(sheergrace.java:203)

    would indicate that your sketch is called 'sheergrace' and that the exception was thrown in the setup() method. Next

    at fisica.FWorld.(Unknown Source)

    would indicate that it occurred in the constructor for the FWorld class in the fiscia package so it was thrown when executing this statement in your code.

    world = new FWorld();

    this calls the constructor in the parent class org.jbox2d.dynamics.World. There is also a mention of the AABB class which defines a rectangle using upper-left and bottom-right corners and I believe is used to define the world limits and uses the width and height variables as defined in the size(...) statement. Hence moving the statement to the start of setup might help.

    Thing 2

    TuioClient: failed to connect to port 3333

    Obviously a problem but I don't know if causes the proble.

    Finally
    In your code I noticed that you are loading images inside the draw() method. This is NOT recommended because it will attempt to load them 60 times a second. Load them in setup and use them in draw.

  • REPOST: https://forum.Processing.org/two/discussions/tagged/nosuchmethoderror

    Expecting this time folks gonna pay attention! 8-|

  • Yes it could be that the libraries you use are incompatible with the version of Processing you are using.

  • java.lang.NoSuchMethodError: org.jbox2d.dynamics.World.<init>(Lorg/jbox2d/collision/AABB;Lorg/jbox2d/common/Vec2;Z)V

    Still no near capable of deciphering such debug lines.
    I believe V means void. If by any chance that constructor depends on any PVector method which returns void, it's not gonna find any in P3! :-h

  • org.jbox2d.dynamics.World does not use PVector this library has its own vector class Vec2

  • has its own vector class Vec2

    Maybe some of Vec2's methods might end up invoking PVector methods in some cases. Who knows? :-/

  • Maybe some of Vec2's methods might end up invoking PVector methods in some cases. Who knows?

    I do and they don't.

    The problem is almost certainly the fisica library it was last updated in March 23 for PS 2.0b8 the OP needs to go back to PS2

    Still no near capable of deciphering such debug lines.

    OK just to help out I will explain

    org.jbox2d.dynamics.World.<init>(Lorg/jbox2d/collision/AABB;Lorg/jbox2d/common/Vec2;Z)V

    L means object and Z boolean so it is looking for a constructor with the following signature

    World(AABB aabb, Vec2 vec, boolean bool)

    HTH :)

  • edited December 2015

    Indeed you know whether Vec2 surreptitiously invokes PVector methods or not since you're the author of Shapes3D! :-j

    Thx for the detail decoding of the bug message.
    Somehow I already was suspicious Z meant boolean. B/c I've recently read about Jython:
    http://www.IBM.com/developerworks/java/tutorials/j-jython2/j-jython2.html#appcharcode
    And in order to create arrays there, we need to specify those letters in order to match Java's type. :P

  • Vec2 is part of the JBox2D library (org.jbox2d.common.Vec2), which I didn't author. It is a Java port of the C++ Box2D library, it is not a port for Processing which is why I know it didn't use PVector in its code. The fisica library is a Processing wrapper for JBox2D so probably does use PVector, which is causing a problem for the OP.

    The Shapes3D library was created specifically for Processing and I used PVector throughout.

    @asangajnr you need to use Processing 2 if you want to use the fisica library

  • thanks guys. I have that part out. this is the current error

    processing.app.SketchException: The function registerDispose(SQL) does not exist.

  • You need to post more of the stacktrace to find out where it is expecting to find the method.

  • edited December 2015

    registerDispose() was @ Deprecated in Processing 2 and completely removed in Processing 3!
    Since Processing 2, all individual "register" type methods were replaced by 1 registerMethod(). :-B

    https://forum.Processing.org/two/discussions/tagged?Tag=registerdispose()

  • edited September 2016

    @asangajnr At least by now you should have posted the formatted code, if only for the benefit of others. Remember, there might others also interested in the post, and the forum relies on everyone contributing whatever they can to it.
    And BTW, could you help me in developing a Monopoly project? I am working on the same :)

Sign In or Register to comment.