Advertisement
Guest User

jiodsfjiodiosaj

a guest
Sep 21st, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1.  
  2. int xPos=10;
  3. int geschwindigkeit=10;
  4. int modus=0;
  5.  
  6. void setup(){
  7.  
  8. size(400,400);
  9. stroke(#8EE3DC);
  10. strokeWeight(50);
  11. point(xPos,200);
  12.  
  13. }
  14.  
  15. void draw(){
  16. background(#5A74FF);
  17. geschwindigkeit*=1.001;
  18. if ( modus == 0 ) {
  19. xPos=xPos+geschwindigkeit;
  20. }
  21. else
  22. {
  23. xPos=xPos-geschwindigkeit;
  24. }
  25. if ( xPos >= 340 ) {
  26. modus=1;
  27. }
  28. if ( xPos <= 0 ) {
  29. modus=0;
  30. }
  31.  
  32. point(xPos,200);
  33.  
  34. line(375,50,375,350);
  35.  
  36.  
  37.  
  38.  
  39.  
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement