Your SlideShare is downloading. ×
Kwp2 091210
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Kwp2 091210

705

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
705
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. int x, y; // (x y ) void setup(){ // size(640,480); frameRate(30); colorMode(HSB,360,100,100,100); noStroke(); fill(200,80,80); x = 0; y = 0; } void draw(){ // background(0); // ellipse(x,y,50,50); // x++; //x y++; //y }
  • 2. if( ){ }
  • 3. //x y float x, y; //x - ,y - float xSpeed, ySpeed; // void setup(){ size(480,480); frameRate(30); colorMode(HSB,360,100,100,100); noStroke(); fill(180,100,80,80); x = random(width); y = random(height); xSpeed = random(-10,10); ySpeed = random(-10,10); }
  • 4. void draw(){ background(0); // ellipse(x,y,40,40); // x+=xSpeed; //x y+=ySpeed; //y if(x > width){ x = 0; } if(x < 0){ x = width; } if(y > height){ y = 0; } if(y < 0){ y = height; } }
  • 5. float x, y, xSpeed, ySpeed; void setup(){ // size(480,480); frameRate(30); colorMode(HSB,360,100,100,100); noStroke(); fill(180,100,80,80); x = random(width); y = random(height); xSpeed = random(-10,10); ySpeed = random(-10,10); } void draw(){ // background(0); ellipse(x,y,40,40); x += xSpeed; y += ySpeed; if(x > width || x < 0){ xSpeed *= -1; } if(y > height || y < 0){ ySpeed *= -1; }

×