Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var i = 0;
- var d = 1;
- var amp = 100;
- engine.background = "#000000";
- engine.size = [1000, 1000];
- engine.setup();
- function tree(x, y, d, c){
- if (d < 10) {
- return;
- } else {
- drawLine(x, y, x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, "#FFFFFF", 1);
- tree(x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, d/2, c+1);
- tree(x+Math.sin(c*45*Math.PI/4)*d, y+Math.cos(c*Math.PI/4))*d, d/2, c-1);
- }
- }
- engine.update = function(){
- //engine.clear();
- tree(500, 800, 256, 0);
- i += 0.02;
- }
- engine.tickspeed = 1;
- engine.start();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement