Step 3Mouth on computer screen
This uses Processing (from www.processing.org)
//PROCESSING CODE
//pacman moouth opens/close with X input from mouse
float x = 0;
float val = 0;
void setup(){
size(200,200);
background(100);
smooth();
}
void draw(){
background(100); //clear last image
val = mouseX;
x = map(val,0,200,0.01,0.3); //translate values input to useful values
println(x);
arc(100,100,50,50,(x)*PI,PI+(1-x)*PI); //draw packman, using radians... p21
}
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|













































