Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int x = 100;
- int y = 100;
- color c = color(255, 255, 255);
- void setup() {
- size(600, 600);
- background(255, 255, 255);
- krugche(x, y, c);
- }
- void draw() {
- }
- void krugche(int x, int y, color c) {
- ellipse(width/2, height/2, x, y);
- }
- void keyPressed() {
- if (keyPressed && key == 'r' ) {
- c =color(255, 0, 0);
- }
- if (keyPressed && key == 'g' ) {
- c =color(0, 255, 0);
- }
- if (keyPressed && key == 'b' ) {
- c =color(0, 0, 255);
- }
- if (keyPressed && key == '1' ) {
- background(255, 255, 255);
- krugche(x, y, c);
- } else if (keyPressed && key == '2' ) {
- background(255, 255, 255);
- krugche(x*2, y*2, c);
- } else if (keyPressed && key == '3' ) {
- background(255, 255, 255);
- krugche(x*3, y*3, c);
- } else if (keyPressed && key == '4' ) {
- background(255, 255, 255);
- krugche(x*4, y*4, c);
- } else if (keyPressed && key == '5' ) {
- background(255, 255, 255);
- krugche(x*5, y*5, c);
- }
- fill(c);
- x=100;
- y=100;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement