setup(): Use setup() to specify things that need to be done once, when the sketch first opens. */ void setup() { size( 200, 200 ); frameRate( 20 ); images[0] = loadImage("PT_anim0000.gif"); images[1] = loadImage("PT_anim0001.gif"); images[2] = loadImage("PT_anim0002.gif"); images[3] = loadImage("PT_anim0003.gif"); } /** ******************** Use draw() to specify things that you want to have done repeatedly. NOTE: draw() must be present in your program, even if it is left empty. */ void draw() { background(#ffffff); frame = ( frame + 1 ) % numFrames; // Use % to cycle through frames image( images[frame], 50+xPos, 50 ); xPos = (xPos + 5); if(xPos > width) { xPos = -100; } } /** ******************** Event Listners: Use event-listners like keyPressed() to allow users of your program to cause things to happen. */ /** ******************** Functions: Functions are sections of code that you create and name.

Source code: BitmapAnimationMovement

Built with Processing