Advertisement
p14082003

rectavoid(main);

Apr 15th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.62 KB | None | 0 0
  1. int score;
  2. int i=0;
  3. laser[] l= new laser[70];
  4. boolean lost=false;
  5.  
  6. void setup() {
  7.   size(displayWidth, displayHeight);
  8.   for (int i=0; i<l.length; i++) {
  9.     l[i]= new laser();
  10.   }
  11.   textSize(24);
  12. }
  13.  
  14.  
  15. void draw() {
  16.   if (lost!=true) {
  17.     background(0);
  18.     shapeMode(CENTER);
  19.     beginShape();
  20.     vertex(15,0);
  21.     vertex(0,25);
  22.     vertex(0,50);
  23.     vertex(30,50);
  24.     vertex(30,25);
  25.     endShape(CLOSE);
  26.  
  27.     for (i=0; i<l.length; i++) {
  28.       l[i].show();
  29.       l[i].fall();
  30.       l[i].touch();
  31.     }
  32.     fill(255);
  33.     text(score, 24, 24 );
  34.   }
  35. }
  36.  
  37. void mousePressed() {
  38.   lost=false;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement