Awesome! Thanks you guys! Especially to jack.kern and fietspomp! The frame rate coding worked perfectly in combination with the "random" code. I guess I can post the final code. xD
There is a random "float" in the beginning because it did not like it when I suddenly put in "random" into the movement equation. When I changed the variable type to "float", the program let the code produce what I was looking for.
int WIDTH=500,HEIGHT=500; //window size
float xlocation, ylocation;
int numFrames = 10; //number of frames for movement
int frame = 0;
void setup() {
//basic window setup
size(WIDTH,HEIGHT);
//image will start from the center
xlocation=213;
ylocation=175;
//frame rate
frameRate(2);
}
void draw() {
background(255);
//movement
xlocation=(random(0,WIDTH)) % (WIDTH-50);
ylocation=(random(0,HEIGHT)) % (HEIGHT-50);
//Body move
stroke(0);
fill(0,255,60,50);
rect(xlocation,ylocation,75,125);
//Hair move
stroke(0);
fill(249,228,33);
ellipse(xlocation+37,ylocation-75,200,125);
//Head move
stroke(0);
fill(249,212,176);
ellipse(xlocation+37,ylocation-25,100,100);
//Left Arm move
stroke(0);
line(xlocation,ylocation+25,xlocation-38,ylocation+60);
line(xlocation-38,ylocation+60,xlocation-88,ylocation+35);
//Right Arm move
stroke(0);
line(xlocation+75,ylocation+25,xlocation+107,ylocation+125);
//Left Leg move
stroke(0);
line(xlocation+7,ylocation+125,xlocation-38,ylocation+165);
line(xlocation-38,ylocation+165,xlocation+12,ylocation+210);
//Right Leg move
stroke(0);
line(xlocation+68,ylocation+125,xlocation+137,ylocation+210);
//Fire Ball move
stroke(249,96,0);
fill(249,96,0,180);
ellipse(xlocation-88,ylocation+15,50,50);
//Eyes move
stroke(0);
fill(255,0,0);
ellipse(xlocation+12,ylocation-35,20,20);
ellipse(xlocation+62,ylocation-35,20,20);
//Mouth
stroke(0);
fill(249,0,129);
rect(xlocation+27,ylocation-5,20,10);
}