Skip to content

Instantly share code, notes, and snippets.

@sabotai
Last active February 6, 2017 17:39
Show Gist options
  • Select an option

  • Save sabotai/0299943f76c9cd502cbaad07389a61d3 to your computer and use it in GitHub Desktop.

Select an option

Save sabotai/0299943f76c9cd502cbaad07389a61d3 to your computer and use it in GitHub Desktop.
//introduce setup and draw into your hw from last week
//replace "hard-coded" values with variables that you declare and assign!
int xPos;
void setup(){
size(1280,720);
xPos = 5;
//frameRate(1);
}
void draw(){
background(200,10,20);
//this will be the head
ellipse(xPos, 150, 200, 300);
xPos = xPos + frameCount; //move the xPos by the total frame count each time draw runs
println("the x position is ... " + xPos);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment