Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.16 KB | None | 0 0
  1. PImage img;
  2. Spaceship Spx;
  3. Asteroid Asx;
  4. Asteroid2 Asy;
  5. Asteroid3 Asz;
  6. Munition Mnx;
  7. //Munition ammo;
  8. Munition2 Mny;
  9. //Munition[] ammo = new Munition[4];
  10.  
  11.  
  12. void settings() {
  13.   size(1300, 900, P3D);
  14. }
  15.  
  16. void setup() {
  17.  
  18.   img=loadImage("dreamstime_xxl_123015144.jpg");
  19.   textSize(25);
  20.  
  21.   Spx = new Spaceship();
  22.   Spx.erstellen();
  23.   Asx = new Asteroid(50,50);
  24.   Asy = new Asteroid2(50, 50);  
  25.   Asz = new Asteroid3(50, 50);
  26.  
  27.  
  28.  
  29.   Munition[] ammo = new Munition[4];
  30.  
  31.       for (int i = 0; i<4; i++) {
  32.  
  33.   ammo[i] = new Munition();
  34.     Mnx = new Munition();
  35.  
  36.   }
  37. }
  38.  
  39. void draw() {
  40.   image(img, 650, 450);
  41.   //image(Sp1, 50, mouseY, 50, 80);
  42.  
  43.   Spx.erstellenX();
  44.  
  45.   //Asx.as_spawn();
  46.   Asx.erstellen2();
  47.   Asy.erstellen2();
  48.   Asz.erstellen2();
  49.   Mnx.show();
  50.   Mnx.move();
  51.   for (int i = 0; i<4; i++) {
  52.   ammo[i].show();
  53.   ammo[i].move();
  54.   }
  55.   //if(dist (xPos1+8,yPos2,xPos,yPos)<=5){
  56.   //  noLoop();
  57.   //}
  58.  
  59.  
  60.  
  61. }
  62.  
  63. void keyPressed() {
  64.   Spx.keyPressed();
  65.  // Mnx.keyPressed();
  66.  
  67.   if(key == 'X'||key == 'x') {
  68.     Mnx = new Munition();
  69.   }
  70.  
  71.     if(key == 'y'||key == 'Y') {
  72.     Mny = new Munition2();
  73.   }
  74.  
  75.  
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement