how to make word in array shake when mouse is pressed?

hi guys, i am new a processing and I was wondering how do I get the word 'tickle' to move/shake when it appears on the screen?

Here is my code so far... thanks so much

var img;
var antonyms = ["tickle", "angry", "raging", "fierce", "sad", "cross", "bitter","sulky"]



function preload(){
  img= loadImage ("tickle.jpeg");
  Indie= loadFont ("IndieFlower.ttf");
}


function setup() { 
  createCanvas(400, 400);
  noLoop();
  textFont (Indie, 48); 



}
function draw() { 
  background(255,255,255);
  image(img, 0,0,200,200);


var rnd_antonyms = random (antonyms);

text ("here", 220,100);
text ("comes", 200, 150);
text ("the", 230, 200);
text (rnd_antonyms, 220, 250);
text ("monster", 200, 300);



}
function keyPressed(){
  draw();
}
Tagged:

Answers

Sign In or Register to comment.