int main_mode = 0; int res1 = 0; int res2 = 0; boolean player1Turn = true; boolean is_running = false; //LilyScriptOne-Regular.ttf PFont font; // create an empty font "container" int score_p1 = 0; int score_p2 = 0; void showScore(){ textSize(22); textAlign(LEFT); text( "PLAYER ONE: " + score_p1, 20,40 ); textAlign(RIGHT); text( "PLAYER TWO: " + score_p2, width-20,40 ); } void setup(){ size(512,512); background(22); font = createFont("LilyScriptOne-Regular.ttf", 18); // load a font from my archive textFont(font); // apply my loaded font } void draw(){ background(44); showScore(); // pulsing value we generate as score basis >>>> range of 0 - 4 float rvalue = ( sin( millis()*.015 ) +1. )*2.; textSize(50); if(player1Turn){ text("<",width/2,height/2); circle( 140,height/2,rvalue*50 ); }else{ text(">",width/2,height/2); circle( width-140,height/2,rvalue*50 ); } }
void mousePressed(){ if( mouseButton == LEFT ){ println("LMB"); if(player1Turn){ println("Spieler 1 hat gedrückt"); player1Turn = !player1Turn; // invert the boolean value } } if( mouseButton == RIGHT ){ println("RMB"); if( !player1Turn){ println("Spieler 2 hat gedrückt"); player1Turn = !player1Turn; // invert the boolean value } } }