lunes, 7 de mayo de 2018
viernes, 27 de abril de 2018
jueves, 26 de abril de 2018
martes, 24 de abril de 2018
jueves, 8 de febrero de 2018
bola rebotando bordes
1:50
No comments
float posX;
float posY;
float desplazamientoY;
float desplazamientoX;
void setup () {
size (400,400);
posX= width/1;
posY= height/3;
desplazamientoY = 1;
desplazamientoX = 1;
}
void draw () {
background (0,255,0);
noStroke();
ellipse(X, posY, 100,100);
fill(0,0,205);
if (posY < 0){
posY =0;
desplazamientoY=1;
}
else if (posY > height){
posY =height;
desplazamientoX =-1;
desplazamientoY =-1;
}
else if (posX < 0){
posX =0;
desplazamientoX=1;
}
else if (posX > height){
posX =height;
desplazamientoX =-1;
}
posX = posX+desplazamientoX;
posY = posY+desplazamientoY;
}
float posY;
float desplazamientoY;
float desplazamientoX;
void setup () {
size (400,400);
posX= width/1;
posY= height/3;
desplazamientoY = 1;
desplazamientoX = 1;
}
void draw () {
background (0,255,0);
noStroke();
ellipse(X, posY, 100,100);
fill(0,0,205);
if (posY < 0){
posY =0;
desplazamientoY=1;
}
else if (posY > height){
posY =height;
desplazamientoX =-1;
desplazamientoY =-1;
}
else if (posX < 0){
posX =0;
desplazamientoX=1;
}
else if (posX > height){
posX =height;
desplazamientoX =-1;
}
posX = posX+desplazamientoX;
posY = posY+desplazamientoY;
}
elipse processing
1:47
No comments
ELLIPSE
int x=50;
int y=50;
void setup() {
size(500,500);
background(55,155, 235);
}
void draw() {
fill(233,122,43);
rect(x, y, 150,150);
stroke(233,122,134);
fill(76,43,123);
ellipse(x,y,100,100);
stroke(76,45,65);
if(keyPressed){
if(key=='w'||key=='W'){
y--;
} else if(key=='s'||key=='S'){
y++;
} else if(key=='a'||key=='A'){
x--;
} else if(key=='d'||key=='D'){
x++;
}
}
}
void mousePressed(){
rect(x, y, 150,150);
fill(132,73,213);
ellipse(x,y,100,100);
fill(233,122,43);
}
void mouseReleased() {
rect(x, y, 150,150);
fill(76,43,123);
ellipse(x,y,100,100);
fill(233,122,43);
}
int x=50;
int y=50;
void setup() {
size(500,500);
background(55,155, 235);
}
void draw() {
fill(233,122,43);
rect(x, y, 150,150);
stroke(233,122,134);
fill(76,43,123);
ellipse(x,y,100,100);
stroke(76,45,65);
if(keyPressed){
if(key=='w'||key=='W'){
y--;
} else if(key=='s'||key=='S'){
y++;
} else if(key=='a'||key=='A'){
x--;
} else if(key=='d'||key=='D'){
x++;
}
}
}
void mousePressed(){
rect(x, y, 150,150);
fill(132,73,213);
ellipse(x,y,100,100);
fill(233,122,43);
}
void mouseReleased() {
rect(x, y, 150,150);
fill(76,43,123);
ellipse(x,y,100,100);
fill(233,122,43);
}