Difference between revisions of "A Moving Circle"

From CodeStuff
Jump to: navigation, search
(Created page with "<edcode> var x = 20; var y = 20; function move() { x += 0.5; y += 0.1; } function draw() { clear(); drawCircle(x,y,5); } run(move,draw,30); </edcode>")
 
Line 4: Line 4:
  
 
function move() {
 
function move() {
   x += 0.5;
+
   x += 5;
   y += 0.1;
+
   y += 1;
 
}
 
}
  
 
function draw() {
 
function draw() {
  clear();
 
 
   drawCircle(x,y,5);
 
   drawCircle(x,y,5);
 
}
 
}
  
  
run(move,draw,30);
+
move();
 +
draw();
 +
 
 +
move();
 +
draw();
 +
 
 +
move();
 +
draw();
 +
 
 +
move();
 +
draw();
 +
 
 
</edcode>
 
</edcode>

Revision as of 01:17, 30 August 2012