Skip to content

Instantly share code, notes, and snippets.

@albertochiwas
Last active August 27, 2017 04:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save albertochiwas/7364b160553b662a61e44ae47ec11121 to your computer and use it in GitHub Desktop.
Save albertochiwas/7364b160553b662a61e44ae47ec11121 to your computer and use it in GitHub Desktop.
Uso de comandos del Avatar API
var av = new Avatar(2);
av.scale(0.5);
frameRate(35);
av.setLimit(1,-5,90); // rango de desplazamiento (angulo limite)
av.setNext(1,5); // velocidad
var draw = function() {
background(155, 125, 196);
if (mouseIsPressed) {
av.next(1,5); // av.rotare(1,5);
}
av.draw(mouseX,mouseY);
//println(av.getLimit(1));
};
@LuisAngel06
Copy link

http://podcast.itch.edu.mx/live-editor/

Hellow world in ITCH podcast.

java script program to animate a predefined avatar.

var av = new Avatar(2);//draw a predefined avatar in ITCH podcast
av.scale(1);
frameRate(30);
av.setAngle(2,30);//Set limits in the angles for elbow
av.setLimit(2,30,90);
av.setNext(2,3);//set angle move for elbow move
println(av.getLimit(2));
var draw = function() {
     background(255, 255, 255); //background 
     if (av.getAngle(1) < 90) { //only to move arm to 90 degrees
       av.rotate(1,2);//move arm
     }
     av.next(2,5);//move the arm into limits
     av.draw(200,200);
};

@LuisAngel06
Copy link

Hellow world in ITCH podcast.

java script program to animate a predefined avatar.
Move the arm like a movement to the entire arm.

var av = new Avatar(2);//draw a predefined avatar in ITCH podcast
av.scale(1);
frameRate(30);
av.setAngle(2,30);//Set limits in the angles for elbow
av.setLimit(2,30,90);
av.setNext(2,3);//set angle move for elbow move
println(av.getLimit(2));
var draw = function() {
     background(255, 255, 255); //background 
     if (av.getAngle(1) < 90) { //only to move arm to 90 degrees
       av.rotate(1,2);//move arm
     }
     av.next(2,5);//move the arm into limits
     av.draw(200,200);
};

@reneariash
Copy link

reneariash commented Aug 27, 2017

/*Animation made on the platform http://podcast.itch.edu.mx/live-editor/, animates an avatar that greets three times over and over again.*/
var av = new Avatar(2);//Draw avatar
av.scale(1);//Avatar scale is set
frameRate(22);//Animation speed
av.setNext(2,3);//set angle move for elbow move
var x=0;//Variable X counts the times that the forearm reaches zero
var draw = function() {
    background(255, 255, 255); //background width
    av.draw(262,200);//The avatar is displayed in the coordinates
    if (av.getAngle(1) === 90 && x!==3) { //Conditions that the arm is 90 degrees and that the number of greetings with the forearm is different from three
        if(x<3){//Ask if the greeting is less than three times
                av.next(2,2);//Mueve el antebrazo
                if(av.getAngle(2)===0){//Ask if the angle is equal to zero
                       x++;//Count the number of greetings
                }
        }
     } else if (x===3) { //Ask if I already greet three times
        av.rotate(1,-2);//Put your arm back
                if(av.getAngle(1)===0){//Ask if the arm angle is zero
                    x=0;//Resets variable X to zero and allows restart animation
                }
        }
     else {//If none of the above conditions is met
      av.rotate(1,2);//The arm rises up to 90 degrees
     }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment