Advertisement
Guest User

Untitled

a guest
Aug 21st, 2019
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.41 KB | None | 0 0
  1. float xpos1;
  2. int one = 0;
  3. PImage alpha;
  4.  
  5.  
  6. void setup()
  7. {
  8. alpha = loadImage("Alpha.png");
  9. size (800, 300);
  10. smooth();
  11. xpos1 = width/2;
  12. }
  13.  
  14. void draw() {
  15. fill(0, 55);
  16. rect(0, 0, width, height);
  17. noStroke();
  18. fill(255, 200);
  19. float mx = mouseX * 0.4 - width/5.0;
  20.  
  21. xpos1 += mx/8;
  22.  
  23. if(xpos1 < -700) { xpos1 = width;}
  24. if(xpos1 > width) { xpos1= -700;}
  25.  
  26. image(alpha, xpos1, 90);
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement