Guest User

Untitled

a guest
Oct 23rd, 2017
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.16 KB | None | 0 0
  1. var a=75,b=100,c=85.5,d=50,e=110,f=72.5,g=87.5;
  2. var h=68.5,i=105.5,j=99,k=62,r=68.5,s=105.5,t=57.5,o=95;
  3. var p=86,q=100,l=62.5;
  4. var moving = false;
  5.  
  6. function setup() {
  7. createCanvas(400, 400);
  8. }
  9.  
  10. function draw() {
  11.  
  12. if(moving){
  13. a=a+1;
  14. b=b+1;
  15. c=c+1;
  16. p=p+1;
  17. d=d+1;
  18. e=e+1;
  19. f=f+1;
  20. g=g+1;
  21. h=h+1;
  22. i=i+1;
  23. j=j+1;
  24. k=k+1;
  25. r=r+1;
  26. q=q+1;
  27. s=s+1;
  28. l=l+1;
  29. t=t+1;
  30. o=o+1;
  31. }
  32. background(255,255,255);
  33. fill(255,0,0);
  34. rect(360,30,40,160);
  35.  
  36. fill(0,255,0);
  37. ellipse(a,25,20,20);
  38. fill(153,0,153);
  39. ellipse(b,25,20,20);
  40. fill(255,0,0);
  41. ellipse(c,41.5,82.5,20);
  42. fill(153,255,51);
  43. ellipse(p,51,82.5,20);
  44. fill(51,255,255);
  45. rect(d,56.5,15,50);
  46.  
  47. rect(e,56.5,15,50);
  48.  
  49. rect(f,55,30,50);
  50.  
  51. fill(255,0,0);
  52. ellipse(g,65.5,20,7.5);
  53. fill(0,128,255);
  54. ellipse(h,112,14.5,14.5);
  55. fill(255,51,255);
  56. ellipse(i,112,14.5,14.5);
  57. fill(0,0,255);
  58. rect(j,116.5,12.5,27.5);
  59. fill(102,0,204);
  60. rect(k,116.5,12.5,27.5);
  61. fill(0,255,0);
  62. ellipse(r,144,14.5,14.5);
  63. fill(102,0,204);
  64. ellipse(s,144,14.5,14.5);
  65. fill(255,102,178);
  66. rect(q,146.5,12.5,27.5);
  67. rect(l,146.5,12.5,27.5);
  68. fill(255,255,51);
  69. rect(t,170,20,20);
  70. fill(204,102,0);
  71. rect(o,170,20,20);
  72.  
  73. textSize(15);
  74. fill(0,255,0);
  75. rect(40,305,40,40);
  76. fill(0);
  77. textAlign(CENTER);
  78. text("Start",59,330);
  79.  
  80. if(mouseX > 40 && mouseX < 80 && mouseY > 305 && mouseY < 345 && mouseIsPressed && !moving){
  81. moving = true;
  82. }
  83.  
  84. textSize(15);
  85. fill(255,0,0);
  86. rect(100,305,40,40);
  87. fill(0);
  88. textAlign(CENTER);
  89. text("Stop",120,330);
  90.  
  91. if(mouseX > 100 && mouseX < 140 && mouseY > 305 && mouseY < 345 && mouseIsPressed && moving){
  92. moving = false;
  93. }
  94.  
  95. textSize(15);
  96. fill(193,193,193);
  97. rect(160,305,80,40);
  98. fill(0);
  99. textAlign(CENTER);
  100. text("Accelerate",200,330);
  101.  
  102. textSize(15);
  103. fill(190,190,190);
  104. rect(160,350,80,40);
  105. fill(0);
  106. textAlign(CENTER);
  107. text("Decelerate",200,375);
  108.  
  109. textSize(15);
  110. fill(255,110,180);
  111. ellipse(280,345,40,40);
  112. fill(0);
  113. textAlign(CENTER);
  114. text("Emergency",285,380);
  115.  
  116. textSize(15);
  117. fill(0);
  118. textAlign(CENTER);
  119. text("Energy",360,315);
  120. text("Emergency",360,360);
  121. text("Mode",365,375);
  122. text("Charger",370,205);
  123. }
Add Comment
Please, Sign In to add comment