Advertisement
Guest User

HAUPTKLASSE

a guest
Apr 22nd, 2021
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. import GLOOP.*;
  2. public class Ufospiel{
  3. private GLKamera kamera;
  4. private GLLicht licht;
  5. private GLTastatur tastatur;
  6. private GLHimmel himmel;
  7.  
  8. private Ufo dasUfo;
  9. private Asteroid a1,a2,a3,a4,a5,a6,a7,a8;
  10. //[...]
  11.  
  12. public Ufospiel(){
  13. kamera = new GLKamera(800,600);
  14. kamera.verschiebe(0,200,500);
  15. licht = new GLLicht();
  16. tastatur = new GLTastatur();
  17. himmel = new GLHimmel("Sterne.jpg");
  18.  
  19. dasUfo = new Ufo();
  20.  
  21. a1 = new Asteroid();
  22. a2 = new Asteroid();
  23. a3 = new Asteroid();
  24.  
  25.  
  26. fuehreAus();
  27. }
  28.  
  29. public void fuehreAus(){
  30. while(!tastatur.esc()){
  31. if(tastatur.istGedrueckt('a')){
  32. dasUfo.bewegeLinks();
  33. }
  34. if(tastatur.istGedrueckt('d')){
  35. dasUfo.bewegeRechts();
  36.  
  37. }
  38. a1.bewegeDich();
  39. a2.bewegeDich();
  40. a3.bewegeDich();
  41.  
  42. //[...]
  43.  
  44. Sys.warte();
  45. }
  46.  
  47.  
  48. Sys.beenden();
  49. }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement