var message = "Tickle Me"; var img = getImage("space/star"); var x = 100; var y = 200; var imgX = 100; var imgY = 200; var txtS = 50; textSize(txtS); var draw = function() { background(67, 22, 88); fill(222, 33, 44); text(message, x, y); if(mouseX > x && mouseX < x + textWidth(message) && mouseY < y && mouseY > y-txtS) { x += round(random(-5, 5)); y += round(random(-5, 5)); } image(img, imgX, imgY); if(mouseX > imgX && mouseX < imgX + img.width && mouseY > imgY && mouseY < imgY + img.height) { imgX += round(random(-5, 5)); imgY += round(random(-5, 5)); } };