Guest User

Untitled

a guest
Mar 22nd, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. int p = 200;
  2. float aa = 0;
  3. float ab = 0;
  4. float ac = 100;
  5. float ad = 100;
  6. float ae = 200;
  7. float af = 200;
  8. float aaspeed = 1;
  9. float abspeed = 1;
  10. float acspeed = 1;
  11. float adspeed = 1;
  12. float aespeed = 1;
  13. float afspeed = 1;
  14.  
  15. int aadirection=4;
  16. int abdirection=4;
  17. int acdirection=2;
  18. int addirection=2;
  19. int aedirection=7;
  20. int afdirection=7;
  21.  
  22. class line {
  23.  
  24. void drawline() {
  25. aa = aa + (aaspeed * aadirection);
  26. ab = ab + (abspeed * abdirection);
  27. ac = ac + (acspeed * acdirection);
  28. ad = ad + (adspeed * addirection);
  29. ae = ae + (aespeed * aedirection);
  30. af = af + (afspeed * afdirection);
  31.  
  32. if (aa > width-p || aa < 0) {
  33. aadirection *= -1;
  34. }
  35. if (ab > height-p||ab <0) {
  36. abdirection*=-1;
  37. }
  38. if (ac > width-p || ac < 0) {
  39. acdirection *= -1;
  40. }
  41. if (ad > height-p||ad <0) {
  42. addirection*=-1;
  43. }
  44. if (ae > width-p || ae < 0) {
  45. aedirection *= -1;
  46. }
  47. if (af > height-p||af <0) {
  48. afdirection*=-1;
  49. }
  50. fill(100,100,255);
  51. rect(aa,ab,150,150);
  52. rect(ac,ad,150,150);
  53. rect(ae,af,150,150);
  54.  
  55.  
  56.  
  57.  
  58. }
  59. }
Add Comment
Please, Sign In to add comment