DEBER Colores ...




CODIGO

void setup() {

  size (500, 500);
  //size(displayWidth, displayHeight);
  background(255);
  colorMode(RGB);
  //colorMode(HSB);
}

void draw() {
  //Alpha
  noStroke();
  rectMode(CORNER);
 
  fill(0,10,10,10);
  rect(250,250,250,250);
  fill(200,20,30,40);
  rect(250,125,250,250);
 
 
  //HSB
  //colorMode(HSB,255);
  colorMode(HSB, 500,50,550);
  color(0,34,43);
  fill(0,554,543,849);
  rectMode(CORNERS);
  rect(500,0,250,250);
 
 
  //Grices
  rectMode(CORNERS);
  noStroke();
  fill(0);
  rect(0,500,250,250);
  fill(20);
  rect(40,500,250,250);
  fill(50);
  rect(85,500,250,250);
  fill(100);
  rect(135,500,250,250);
  fill(150);
  rect(180,500,250,250);
  fill(210);
  rect(220,500,250,250);
 
 
  rectMode(CORNERS);
  colorMode(RGB);
  fill(14,4,53);
  rect(0,0,250,250);
 
 
}

Juego acelerado


boolean  gameOver = true;

float posX;
float posY;

float speedX = 1;
float speedY = 1;     //DECLARAMOS

void setup () {
  size (500, 500);
  posY = random (height);
  posX = random (width);
  rectMode (CENTER); //posision del rectangulo de la base
  posX = width/2;
  posY = height/2;
}

void draw () {
  background (0);

  if (gameOver == true) {   //codigos para que salga game over
    background (#048630);   //fondo de ventana game over
    fill(255);    //color texto
    text ("GAME OVER", width/2, height/2);   //texto
  }

  else {    //codigos para cuando se esta jugando
    fill(255);    //color texto
    text("JUGANDO", width/2, height/2);    //texto

  fill (255);
  rect( mouseX, height*0.95, 80, 10);   //rectangulo: tamaños y codigo para que funcione con el mouse
  fill (#F50202);
  ellipse (posX, posY, 10, 10);

  if (speedY > 10) {
    speedY = 6;
  }

  if (posY > height) {
    speedY = -(speedY*1);  //AUMENTAMOS LA VELOCIDAD EN Y DE ABAJO
    posY = height;
  }
  if (posY < 0) {
    speedY = -(speedY*2); // AUMENTAMOS VELOCIDAD EN Y ARRIBA
    posY = 0;
  }
  if (posX > width) {
    speedX = -(speedX*1); //AUMENTAMOS VELOCIDAD EN X DERECHA
    posX = width;
  }
   if (posX < 0) {
    speedX = -(speedX*1);  //AUMENTAMOS VELOCIDAD EN X IZQUIERDA
    posX = 0;
  }

  if (posY == height) //codigo para cuando se reinicie y la pelotita salga del centro
{
  posX = width/2;
  posY = height/2;
  gameOver = true;
  speedX = speedX ;
  speedY = speedY ;
}
    if (posX > mouseX-30 && posX < mouseX + 30 && posY > 0.95*height-5 && posY < 0.95*height+5){
  speedX = speedX;
  speedY = -1*speedY;
    }


  posX = posX+speedX;
  posY = posY+speedY;
}
}
void keyPressed() {   //codigos para que se reinicie el juego
  if (gameOver == true) {
    gameOver = false;
  }
}
Deber Juego



boolean  gameOver = true; //DECLARAMOS (EN ESTE CASO VERDADERO)

float posX; // DECLARAMOS POSICIONES DE X /  Y
float posY;

float speedX = 3;  //DECLARAMOS VELOCIDAD DE X /Y
float speedY = 3;

void setup () {
  size (500, 500);
  posY = random (height);  //POSCICION ALEATORIA
  posX = random (width);
  rectMode (CENTER); //POSCICION DEL RECTANGULO EN LA BASE
  posX = width/2;
  posY = height/2;
}

void draw () {

  if (gameOver == true) {   // CONDICIONAL IF (GAME OVER)
    background (#100630);   // FONDO VENTANA GAME OVER
    fill(200);    //color texto
    text ("GAME OVER", width/2, height/2);   // TEXTO
  } else {    // CODIGOS PARA CUANDO SE ESTA JUGANDO

    fill(255);    //COLOR DE TEXTO
    text("JUGANDO", width/2, height/2);    //TEXTO


  fill (255);
  rect( mouseX, height*0.95, 80, 10);   //RECTANGULO (MOVIMIENTO CON EL MOUSE)
  fill (#F02222);
  ellipse (posX, posY, 10, 10);


  if (posY > height) {
    speedY = -random(1,4);
    posY = height;
  }
  if (posY < 0) {
    speedY = 3;
    posY = 0;
  }
  if (posX > width) {
    speedX = -random(1,4);
    posX = width;
  }
   if (posX < 0) {
    speedX = -speedX;
    posX = 0;
  }

  if (posY == height) //REINICIO DE LA PELOTA
{
  posX = width/2;
  posY = height/2;
  gameOver = true;
  speedX = speedX ;
  speedY = speedY ;
}
    if (posX > mouseX-30 && posX < mouseX + 30 && posY > 0.95*height-5 && posY < 0.95*height+5){
  speedX = speedX;
  speedY = -1*speedY;    //REBOTE EN EL RECTANGULO
    }


  posX = posX+speedX;
  posY = posY+speedY;
}
}
void keyPressed() {   //REINICIO DE JUEGO ( APLASTANDO UNA TECLA)
  if (gameOver == true) {
    gameOver = false;
  }
}
Leccion 4... Condicionales


float posX;
float posY;
float desplazamiento; // DECLARAMOS LAS DIFERENTES VARIABLES A USAR
float mm;

void setup (){
size(800, 800);   //TAMAÑO DEL DOCUMENTO
posX = width/2;   //POSCICION X EN EL ANCHO DEL DOCUMENTO    (ACTIVAR)  
posY = height/2; // POSCICION Y EN LA ALTURA (ACTIVAR
desplazamiento = -2;  //ACTIVAR EL DESPLAZAMIENTO EN Y
mm= -2;  // ACTIVAMOS EL DESPLAZAMIENTO EN X
}

void draw(){
  background (0);
  fill(#55E364); //COLOR (VERDE)
  ellipse(posX, posY, 300, 300); //ELIPSE
  if(posY < 0){      //CONDICIONAL
  desplazamiento= 1;
  }
  else if (posY> height){ //CONDICIONAL
    desplazamiento= -1;     //SUBIR
  }
 
  posY = posY + desplazamiento  ;
  posX= posX + mm;

  if (posX < 0){
    mm= 2;
  }
  else if (posX > width){  //CONDICIONAL
    mm= -2;  //BAJA
  }
}


Processing Ideas.... 

//DECLARAMOS ESTAS PRIMERAS TRES VARIABLES

String string;  //DECLARA EL TEXTO QUE APARECERA AL IMPRIMIR
float J = 50;    //DECLARA   TAMAÑO DE LETRA A USAR
float P = height; // DECLARA POSCICION


void setup() {

  size (1300,700);  //TAMAÑO DEL DOCUMENTO
  textAlign(CENTER); //ALINEAR AL CENTRO
  frameRate(10);   //VELOCIDAD DEL TEXTO
  textSize(300);     //TAMAÑO DE TEXTO
  string = "Viviendo no envejeces";   // FRASE A USAR

}

void draw() {

  J= J-2.9;   //ACTIVAMOS EL CODIGO ASCII
  P= P -10;
background (0);  //FONDO (NEGRO)

fill(255,255,0);   //COLOR DE TEXTO (AMARILLO)
textSize(200+J); //INDICA COMO VA A VARIAR EL TEXTO
text(string,width/2,height + P);
}