Advertisement
ahorsewithnoname

Voluntario1

Apr 20th, 2021
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.79 KB | None | 0 0
  1. int ty = 130;
  2. int tx = 76;
  3. int xini = 5;
  4. int yini = 8;
  5. int ani = 1;
  6.  
  7. void setup(){
  8.   size(330,145);
  9.   background(255);
  10.   strokeWeight(1);
  11.   stroke(0);
  12. }
  13.  
  14. void draw(){
  15.   fill(0);
  16.  
  17.   translate(xini,yini);
  18.   if(ani == 1){
  19.     fill(255,255,0);
  20.   }
  21.   else{
  22.     fill(207,226,243);
  23.   }
  24.   triangle(0,0,tx,ty/2,0,ty);
  25.   translate(tx+xini,0);
  26.   if(ani == 2){
  27.     fill(255,255,0);
  28.   }
  29.   else{
  30.     fill(207,226,243);
  31.   }
  32.   triangle(0,0,tx,ty/2,0,ty);
  33.   translate(tx+xini,0);
  34.   if(ani == 3){
  35.     fill(255,255,0);
  36.   }
  37.   else{
  38.     fill(207,226,243);
  39.   }
  40.   triangle(0,0,tx,ty/2,0,ty);
  41.   translate(tx+xini,0);
  42.   if(ani == 4){
  43.     fill(255,255,0);
  44.   }
  45.   else{
  46.     fill(207,226,243);
  47.   }
  48.   triangle(0,0,tx,ty/2,0,ty);
  49.   ani++;
  50.   if(ani == 5){
  51.     ani = 1;
  52.   }
  53.   delay(100);
  54. }
  55.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement