rotating shapes
in
Programming Questions
•
1 year ago
hi there i am new to using processing just started it in college was wondering how to rotate the pacman in my code below so it turn round when it touches side of the screen . any help would be much appreciated .
int x = 300;
int y = 300;
int speed = 3;
int radius = 100;
float mouth = 3.60;
;
void setup (){
size (600,600);
}
void draw (){
background (0);
fill (255,255,0);
arc(x,y,radius,radius,mouth,8.90);
mouth = mouth + 0.05;
if (mouth > 3.60){
mouth = mouth* -0.01;
}
x = x + speed ;
if (x > 600 || x<0){
speed = speed * -1;
}
}
int y = 300;
int speed = 3;
int radius = 100;
float mouth = 3.60;
;
void setup (){
size (600,600);
}
void draw (){
background (0);
fill (255,255,0);
arc(x,y,radius,radius,mouth,8.90);
mouth = mouth + 0.05;
if (mouth > 3.60){
mouth = mouth* -0.01;
}
x = x + speed ;
if (x > 600 || x<0){
speed = speed * -1;
}
}
1