We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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();
}
Answers
If a word is marked as shaking
add a +random(-4,4)
And please format your code.
Press the gear icon to edit your post.
Select your code and press ctrl + o.
Leave a line above and below the code.
@tor909: See also the recent related discussion on "how to tickle":