Basic - Árbol con hojas (BBC Basic)

 
Vista:

Árbol con hojas (BBC Basic)

Publicado por Laura (1 intervención) el 24/12/2015 01:40:49
Tengo el siguiente código:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
Spread = 25
      Scale = .75
      SizeX% = 1200
      SizeY% = 900
      Depth% = 10
 
 
      VDU 23,22,SizeX%;SizeY%;8,16,16,128
 
      PROCbranch(SizeX%, 0, SizeY%/2, 90, Depth%)
      END
 
      DEF PROCbranch(x1, y1, size, angle, depth%)
      LOCAL x2, y2
      x2 = x1 + size * COSRAD(angle)
      y2 = y1 + size * SINRAD(angle)
      VDU 23,23,depth%;0;0;0;
      LINE x1, y1, x2, y2
      WAIT 1
      IF depth% > 0 THEN
        PROCbranch(x2, y2, size * Scale, angle - Spread, depth% - 1)
        PROCbranch(x2, y2, size * Scale, angle + Spread, depth% - 1)
 
      ENDIF
      ENDPROC

El cual dibuja las ramas de un árbol. Ahora me gustaría añadir código para que le salieran hojas verdes pero no sé cómo hacerlo. ¿Me pueden dar alguna idea?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder