> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://seneca-cdot.sketchpad.cc/sp/pad/view/ro.WQc43xIG1qL/rev.2
 * 
 * authors: 
 *   Catherine Leung

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



//Walk sequence animation
//Art work by "TheZakMan" at OpenGameArt.org
//http://opengameart.org/content/plataform-walk-jump-animation-side-view
//Licenced under CC-BY 3.0 license
 
/* @pjs preload="/static/uploaded_resources/p.6010/walk01.png,
                 /static/uploaded_resources/p.6010/walk02.png,
                 /static/uploaded_resources/p.6010/walk03.png,
                 /static/uploaded_resources/p.6010/walk04.png,
                 /static/uploaded_resources/p.6010/walk05.png,
                 /static/uploaded_resources/p.6010/walk06.png,
                 /static/uploaded_resources/p.6010/walk07.png,
                 /static/uploaded_resources/p.6010/walk08.png,
                 /static/uploaded_resources/p.6010/walk09.png,
                 /static/uploaded_resources/p.6010/walk10.png,
                 /static/uploaded_resources/p.6010/walk11.png,
                 /static/uploaded_resources/p.6010/walk12.png,
                 /static/uploaded_resources/p.6010/walk13.png,
                 /static/uploaded_resources/p.6010/walk14.png,
                 /static/uploaded_resources/p.6010/walk15.png,
                 /static/uploaded_resources/p.6010/walk16.png,
                 /static/uploaded_resources/p.6010/walk17.png,
                 /static/uploaded_resources/p.6010/walk18.png,
                 /static/uploaded_resources/p.6010/walk19.png,
                 /static/uploaded_resources/p.6010/walk20.png,
                 /static/uploaded_resources/p.6010/walk21.png,
                 /static/uploaded_resources/p.6010/walk22.png,
                 /static/uploaded_resources/p.6010/walk23.png,
                 /static/uploaded_resources/p.6010/walk24.png,
                 /static/uploaded_resources/p.6010/walk25.png,
                 /static/uploaded_resources/p.6010/walk26.png,
                 /static/uploaded_resources/p.6010/walk27.png,
                 /static/uploaded_resources/p.6010/walk28.png,
                 /static/uploaded_resources/p.6010/walk29.png,
                 /static/uploaded_resources/p.6010/walk30.png,
                 /static/uploaded_resources/p.6010/walk31.png";
*/ 
 
PImage [] walk = new PImage[31];  //31 frames in the walk cycle
int sequenceid=0;
 
void setup(){
  size(500,500);
  for(int i=0;i<31;i++){
    walk[i]=loadImage("/static/uploaded_resources/p.6010/walk"+(i<9?"0":"") + (i+1) + ".png");
  }
  imageMode(CENTER);
}
 
void draw(){
  background(255);
  image(walk[sequenceid], width/2, height/2);
  sequenceid++;
  if(sequenceid==31)
    sequenceid=0;
}