miércoles, 9 de abril de 2014
Programa ROV
int tubX=400;
int rovY=100;
float burtam=random (15,40);
int burbuja=400;
float xbur=random (20,480);
void setup (){
size (500,400);
rectMode (CENTER);
}
void draw (){
background (80,100,200);
noStroke ();
fill (200,190,130);
rect (250,375,500,50);
text (mouseX,mouseX,10);
text (mouseY,5,mouseY);
fill (255,100);//color burbuja
stroke (255);
ellipse (xbur,burbuja,burtam,burtam);
burbuja=burbuja-1;
if (burbuja==0){burbuja=400;xbur=random (20,480); burtam=random (15,40);}
//submarino
fill (220,220,40);
stroke (220,220,40);
rect (100,rovY,50,20,5);
fill (0); stroke (0);
rect (90,rovY+10,40,10,2);
fill (255,0,0);
text ("ROV",90,rovY+3);
rovY=rovY+1;
if (rovY>335){ rovY=335;}
if (rovY<20 rovy="20;}<br">if (mousePressed){ rovY=rovY-10;}
//tuberias
fill (110,215,15);
stroke (0,0,0);
rect (tubX,290,60,120,5);
rect (tubX,60,60,120,5);
tubX=tubX-2;
if (tubX<0 tubx="530;}</p">}0>20>
Suscribirse a:
Entradas (Atom)