Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- size(600,600);
- background(#DEF2F3);
- //draw series of waves
- fill(#1093A7);
- noStroke();
- ocean();
- int waveStart = 0;
- while(waveStart < width)
- {
- int waveY = height - 110 + (int)random(15);
- wave(waveStart,waveY);
- waveStart = waveStart + 90 + (int)random(10);
- }
- for(int i = 0; i < 7; i++)
- {
- flyingSaucer((int)random(width), (int)random(2*height/3));
- }
- }
- void draw()
- {
- }
- void wave(int x, int y)
- {
- beginShape();
- vertex(x,y);
- bezierVertex(x+60,y-23,x+60,y-46,x+40,y-70);
- bezierVertex(x+80,y-46,x+65,y-23,x+110,y);
- vertex(x,y);
- endShape(CLOSE);
- }
- void ocean()
- {
- rect(0,height - 115,width,115);
- }
- void flyingSaucer(int x, int y)
- {
- fill(#24454C);
- ellipse(x,y,40+(int)random(40), 30 + (int)random(10));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement