Modify a text file: $/old/Run__Thomas__Run_2_.pde
$/old/Run__Thomas__Run_2_.pde
// mouse moves gold // man is thomas // thomas chases gold // 10 points if he catches gold // when catches gold thomas resets String title="Run, Thomas, Run"; String author="Bruce The Best"; String news="."; float thomasX, thomasY, thomasXX, thomasYY, thomassize1, thomassize2, thomassize3, thomassize4; float goldX, goldY; int score=0; float horizon; void setup() { size( 1000, 800 ); horizon= height/4; goldX=80; goldY=horizon+80; thomassize1= 80; thomassize2= 120; thomassize3= 40; thomassize4= 70; reset(); } void reset() { thomasX= random( width/2, width-20); thomasY= random( height/2, height-30); } void draw() { background( 100, 200, 255 ); fill(80, 255, 80); rect( 0,horizon, width, height-horizon); // messages fill(0); textSize(24); text( title, width/3, 80); text( "SCORE: "+score, width*3/4, 40); textSize(12); text( author, 20, height-20); text( news, 20, 80); if(score < -99) { reset(); background(0); score= 0; thomassize4= thomassize4+10; thomassize3= thomassize3+10; thomassize2= thomassize2+10; thomassize1= thomassize1+10; } action(); } void action() { // gold noStroke(); fill( random( 200, 255), random( 200, 255), random(0, 50) ); ellipse( goldX, goldY, 60, 60); fill( random( 200, 255), random( 200, 255), random(0, 50) ); ellipse( goldX, goldY, 40, 40); fill( random( 200, 255), random( 200, 255), random(0, 50) ); ellipse( goldX, goldY, 20, 20); strokeWeight(1); //thomas fill(255, 100, 100); ellipse( thomasX, thomasY, thomassize3, thomassize4); fill(0, 140, 255); rect( thomasX-40, thomasY+35, thomassize1,thomassize2); // thomas chases gold thomasX= thomasX+thomasXX; thomasY= thomasY+thomasYY; thomasXX= (goldX-thomasX) / 45; thomasYY= (goldY-thomasY) / 45; if(dist( goldX, goldY, thomasX, thomasY) < 100 ) { news= "Thomas got the gold!"; score= score-10; reset(); } } void keyPressed() { if(key == 'q') exit(); if(key == 'r') reset(); if(key == 'z') background(255); } void mousePressed() { if( mouseY > horizon) { goldX= mouseX; goldY= mouseY; } }