Help move my character pls!
in
Programming Questions
•
1 year ago
Hi Guys,
So I just started a processing class, and I really do not understand it. I got the basics, but the more command keys I learn and the less explaining my teacher does, the more confused I am. But if someone can help me move my character in an animation that would be great. Here is the code.
void setup() {
size (400,400);
smooth ();
frameRate (30);
}
void draw (){
background (255);
ellipseMode (CENTER);
rectMode (CENTER);
stroke (0);
fill (239,255,20); //yellow body
ellipse(mouseX,mouseY,100,150); // HEAD
stroke (0);
fill(255); // white
ellipse (mouseX-20,mouseY-30,30,40); // left eye
stroke (0);
fill (255); //white
ellipse (mouseX+20,mouseY-30,30,40); // right eye
stroke(0);
line (mouseX-50,mouseY,pmouseX-70,pmouseY-20); // left arm
stroke (0);
line (mouseX+50, mouseY, pmouseX+65,pmouseY-20); // right arm
stroke (0);
fill(mouseX,0,mouseY); //black
ellipse (mouseX-20,mouseY-30,5,15); // left pupil
stroke(0);
fill (mouseX,0,mouseY); //black
ellipse (mouseX+20,mouseY-30,5,15); // right pupil
stroke(0);
fill (142,255,228);// blue
ellipse (mouseX,mouseY+40,75,70); // belly
stroke(0);
line (mouseX-20,mouseY-3,pmouseX+20,pmouseY-3); // mouth
fill (255,36,102);
stroke (252,13,33);
line (mouseX-60,mouseY-60,pmouseX+60,pmouseY-60); // flat line for hat
rect(mouseX-1,mouseY-76,65,30); // hat
}
He moves with the mouse, and now I am trying to just get him to move verticle up the page, bottom to top. I changes the information between the () for each variable but that isn't working. Just making it a huge mess.Please write back to me and explain in detail.
Thank you
1