int bolaX=400,bolaY=300,velX=5,velY=5,raquetaX,points=0; int level=1; void setup(){ size(800,600); fill(0); rectMode(CENTER); } void draw(){ background(255); bola(); raqueta(); textSize(20); text("POINTS: " + points,50,50); text("LEVEL: " + level,50,70); if(bolaY>600){ background(0); textSize(50); fill(255); text("GAME OVER",250,200); stop(); text("FINAL POINTS: " + points,250,300); text("FINAL LEVEL: " + level,250,400); } } void raqueta(){ raquetaX=mouseX; if (raquetaX>750){ raquetaX=750; } if (raquetaX 520 && raquetaX-50 775){ velX=-velX; } if (bolaY
Comentarios
Publicar un comentario