Advertisement
cpmct32

Untitled

Jun 5th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. var i = 0;
  2. var d = 1;
  3. var amp = 100;
  4. engine.background = "#000000";
  5. engine.size = [1000, 1000];
  6. engine.setup();
  7. function tree(x, y, d, c){
  8. if (d < 10) {
  9. return;
  10. } else {
  11. drawLine(x, y, x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, "#FFFFFF", 1);
  12. tree(x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, d/2, c+1);
  13. tree(x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, d/2, c-1);
  14. }
  15. }
  16. engine.update = function(){
  17. //engine.clear();
  18. tree(500, 800, 256, 0);
  19. i += 0.02;
  20. }
  21. engine.tickspeed = 1;
  22. engine.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement