SHARE
TWEET

Untitled

a guest Apr 23rd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. PImage img;
  2. Bullet c;
  3. Bullet c1;
  4. Bullet c2;
  5. Bullet c3;
  6. Bullet c4;
  7. Bullet c5;
  8. Bullet c6;
  9. int wait = 5000;
  10. int time = millis();
  11. int increase;
  12.  
  13. float speed;
  14. int directionX = -1;
  15. int _x = 980;;
  16. int _y;
  17.  
  18.  
  19. void setup() {
  20.   size(1280, 720);
  21.   background(255);
  22.   img = loadImage("recorder1280_720.jpg");
  23.   time = millis();
  24.   c = new Bullet(980, height/2-204);
  25.   c1 = new Bullet(980, height/2-204+(63*1));
  26.   c2 = new Bullet(980, height/2-204+(63*2));
  27.   c3 = new Bullet(980, height/2-204+(63*3));
  28.   c4 = new Bullet(980, height/2-204+(63*4));
  29.   c5 = new Bullet(980, height/2-204+(63*5)+4);
  30.   c6 = new Bullet(980, height/2-204+(63*6)+11);
  31.  
  32. }
  33.  
  34. void draw() {
  35.   background(img);
  36.  
  37.   if (millis() - time >= wait) {
  38.     increase++;
  39.     time = millis();
  40.     println(increase);
  41.     _x = 980;
  42.   }
  43.  
  44.   switch(increase) {
  45.     case 0:
  46.       c();
  47.       break;
  48.     case 1:
  49.       b();
  50.       break;
  51.   }
  52.    
  53.  
  54.   /*
  55.   c.display();
  56.   c.move(speed);
  57.   c1.display();
  58.   c1.move(speed);
  59.   c2.display();
  60.   c2.move(speed);
  61.   c3.display();
  62.   c3.move(speed);
  63.   c4.display();
  64.   c4.move(speed);
  65.   c5.display();
  66.   c5.move(speed);
  67.   c6.display();
  68.   c6.move(speed);
  69.  
  70.   */
  71.  
  72. }
  73.  
  74. void move(float tspeed) {
  75.     speed = tspeed;
  76.     _x += speed * directionX;
  77. }
  78.  
  79. void circle(int longitude) {
  80.   if (_x > width/10) {
  81.       _y = longitude;
  82.       noStroke();
  83.       fill(255, 0, 0);
  84.       circle(_x, _y, 15);
  85.   }
  86. }
  87.  
  88. void c() {
  89.   move(3);
  90.   circle(height/2-204);
  91. }
  92.  
  93. void b() {
  94.   move(3);
  95.   circle(height/2-204);
  96.   circle(height/2-204+(63*1));
  97. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top