Trying to cover an image? Likely a stupid fix.
in
Programming Questions
•
1 year ago
I'm quite new to processing, and am currently working on this project with an interactive little character. The code starts off with an animated sequence, but what I'm having problems with now is at the end of the animated sequence, I want the user to push keys (essentially "talk" to the character) and as they push a key, a new small ellipse starts covering the screen.
But since everything is continuously looping, the ellipse only stays for the length of one frame-so a split second. I want a new ellipse every key press and for all the old ones to stay. And I'm drawing a blank. Much help would be appreciated.
- PImage mipsy;
- void setup() {
- size(900, 770);
- frameRate(10);
- mipsy = loadImage("87.png");
- }
- void draw() {
- background(255,70,130);
- image(mipsy, 0, 0);
- }
- void keyPressed() {
- fill(255);
- smooth();
- noStroke();
- ellipseMode(CENTER);
- ellipse(random(0,width),random(0,height),15,15);
- }
1