Create a Stick Figure Animation from a series of independent frames. Your stick figure can wave, run, dance, fight... use your imagination!
To do this you will use a "state machine" where you sequence through a series of actions. Here is some code to get you started:
State Machine Example Code
int frame;
void setup ()
{
size(500,500);
frame = 1;
fill(255);
strokeWeight(40);
stroke(255);
frameRate(3);
}
void draw()
{
background(0);
switch(frame)
{
case 1:
// insert code for frame 1 here
break;
case 2:
// insert code for frame 2 here
break;
case 3:
// insert code for frame 3 here
break;
case 4:
// insert code for frame 4 here
break;
case 5:
// insert code for frame 5 here
break;
}
frame++;
if (frame > 5)
{
frame = 1;
}
}