My idea is making a background with the watercolor effect used by steve maker’s space on youtube. I succeeded making it into a function and put it in the setup function. Now I have a background with a nice texture I would like to keep.
Now I want to a bubble to rise from the bottom without leaving a trail (seeing the previous position it has been in). And I can not figure out how to do it. At the moment I using the createGraphics function but it is still leaving a trail. If I put a background function in the draw function it will overlay the watercolor function background I made. Same goes if I make it part of createGraphics function (cnv.background). How do I solve this problem? Am I just over thinking it?
The code I have so far:
let cnv;
let bg;
//random walk
let dot_move = 100;
let col_shift = 2;
// moving part
let x = 0;
let y = 0;
function preload(){
bg = loadImage(‘paper24.jpg’);
}
function setup() {
createCanvas(1080, 1080);
noStroke();
//background watercolor paper texture
colorMode(HSB);
background(210,0,100);
watercolor();
// paper texture
tint(0,0,100,0.5);
image(bg,0,0,width,height);
cnv = createGraphics(100,100);
}
function draw(){
cnv.stroke(255);
cnv.strokeWeight(3);
cnv. noFill();
cnv.ellipse(50,50,50);
imageMode(CENTER);
push();
translate(width/2,height);
image(cnv,0,y);
pop();
y--
}
// function for watercolor