java - Recursive Applet Fractal Draw | Only draws first call? -


So I have posted a problem with this problem before going back to the program and making some changes, even then There is another problem. I run the program and it only processes a call to 'branch ()'. I am not sure what will be the cause of the problem, instead of having everything in a class, I use a class and an applet for my program Changed. Thanks for any help. Apart from this everything is also imported.

  Expands the public square treeapple applet {int width, height; Tree tree; Image page; Draw graphics; Public zero init () {width = 1000; Height = 600; SetSize (width, height); SetBackground (Color.black); Page = this.createImage (width, height); Draw = page.getGraphics (); Tree = new tree (width, height, 100); } Public Zero Color (Graphics G) {tree.draw (Draw); G.drawImage (pages, 0,0, this); }} Public square tree {int x, y, x1, x2, y1, y2; Integer width, height; Int lane, tempection 1 = 0, heating 2 = 0; Int smallest = 10; Double fractalanthyl = .85; Double Bran; //, Count; Int angle; Double rand; Public tree (int w, int h, int b) {width = w; Height = h; Bran = B; X = width / 2; Y = height; X1 = x; Y1 = y; X2 = x 1; Y2 = y1-100; } Public Zero Draw (Graphics G) {G. Composition (colorful green); G.drawLine (x1, y1, x2, y2); Branch (g, x2, y2, 20); } Public Zero setbran (int x) {bran = x; } Public Zero Branch (Graphics G, int x, int y, int ang) {x1 = x; Y1 = y; RAND = ANG * (Math.PI / 180); Brinjal = Bran * Attitude * (Mathematics. Random) / 10.0 + 9); Int xChange = (int) (Math.sin (Rand) * Bran); Int ychange = (int) (Math.cos (Rand) * Bran); Y2 = y-y change; /system.out.printf("X1 |% 3d \ tX2 |% 3d \ ty |% 3d \ tExchange |% 3d \ tChangeY |% 3d \ n ", x1-xChange, x1 + xChange, y2, X Change, Y Change); * / G .setting (color blue); G.drawLine (x1, y1, x 1-Xchange, y2); G.setColor (Color.orange); G.drawLine (x1, y1, x 1 + xchange, y2); If (Bran & gt; Small Brain) {branch (g, x1-xChange, y2, angle + 10); Branch (g, x 1 + xchange, y2, ang + 10); }} // end of the branch}  


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -