//clase (objeto) scoreKeeper class scoreKeeper{ int playerLeft,playerRight; boolean playing = true; scoreKeeper(int _s){ playerLeft=0; playerRight=0; maxScore = _s; } void playerLeftScored(){ if(playing){ playerLeft ++; } } void playerRightScored(){ if(playing){ playerRight ++; } } void update(){ checkScore(); drawLine(); updateText(); } void checkScore(){ if(playerRight >= maxScore || playerLeft >= maxScore){ playing = false; } } void drawLine(){ int interval = 20; int theLength = 10; int myWidth = 3; strokeWeight(myWidth); stroke(screenColor); fill(screenColor); for(int i=0;i= maxScore){ text("Player 2 WINS!", 200, height/2); } else { text("Player 1 WINS!", 200, height/2); } } text("Player 1: "+playerLeft+" Player 2: "+playerRight, 114, height-25); } }//Fin de la clase scoreKeeper