//clase (objeto) paddle class paddle{ //iniciamos variables String position; float speed, x, y; int myWidth,myHeight; //constructor paddle(String _p,float _speed, float _margin, int _w, int _h){ speed = _speed; y = height/2; if(_p=="left"){ x = _margin; } else{ x = width - _margin; } position = _p; myWidth = _w; myHeight = _h; } //////FUNCIONES MOVIMIENTO void update(){ setPosition(); drawMe(); } void setPosition(){ if(mouseMovesPaddles){ y = mouseY; } //Aquí habrá de especificarse como arduino efecta la pala } void drawMe(){ noStroke(); fill(screenColor); rect(x,y,myWidth,myHeight); } ///////RETORNAR VALORES float getContactY(){ return y+myHeight/2; }; float getContactX(){ if(position == "left"){ return x+myWidth; } else { return x; } }; float getMyHeight(){ return myHeight; }; }//fin de la clase paddle