How to make a very basic 2 frame animation?
in
Programming Questions
•
1 month ago
Hey Guys. So, I have just started using processing/programming 2 days ago, and have decided to try animating something. So far, I made a basic pacman outline, and my goal is now to make his mouth open and close (I've tried just randomizing the arc, but seeing as that goes through all the positions instead of just open and closed, it made my poor pacman look like he was having a seizure) -- however, no matter what I try, I for some reason cannot loop these 2 different frames. I'll put in the code for the body just in case, and would be very grateful if anyone could help;;
- void setup () {
- size (600, 600);
- }
- void draw () {
- background (255);
- //pacman with mouth open
- frameRate (10);
- stroke (255, 255, 255);
- fill(255, 243, 0);
- arc (mouseX, mouseY, 50, 50, QUARTER_PI, PI+HALF_PI+QUARTER_PI);
- // pacman with mouth closed
- stroke (255, 255, 255);
- fill (255, 243, 0);
- ellipse (mouseX, mouseY, 50, 50);
- }
1