Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int w = 20;
- int h = 20;
- int index = 10;
- void setup(){
- size(500,300);
- background(0);
- strokeWeight(5);
- stroke(255);
- smooth();
- }
- void draw() {
- int x1 = w* index;
- int x2 = x1+w;
- int y1= h*10;
- int y2 = h*11;
- if (random(2) < 1) {
- line (x2,y1,x1,y2);
- }else{
- line(x1,y1,x2,y2);
- }
- index++;
- if (index== width/w) {
- //PImage(width, height, format, factor)
- PImage p = get( 0, h, width, h*10);
- background (0);
- set(0,0,p);
- index=0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement