topical media & game development

talk show tell print

graphic-processing-learning-04-example-4-3-example-4-3.pde / pde



  // Learning Processing
  // Daniel Shiffman
  // http://www.learningprocessing.com
  
  // Example 4-3: Varying variables
  
  // Declare and initialize two integer variables at the top of the code.
  int circleX = 0;
  int circleY = 100;
  
  void setup() {
    size(200,200);
    smooth();
  }
  
  void draw() {
    background(255);
    stroke(0);
    fill(175);
    // Use the variables to specify the location of an ellipse.
    ellipse(circleX,circleY,50,50);
    
    // An assignment operation that increments the value of circleX by 1.
    circleX = circleX + 1;
  }
  
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.