Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- global DIM seedx#(1337) ` Seed X
- global DIM seedy#(1337) ` Seed Y
- global DIM seeda#(1337) ` Seed Angle
- global seednum AS INTEGER = 1
- global grow_distance# = 0.75;
- global obj AS INTEGER = 1
- global cx AS INTEGER = 0
- global cy AS INTEGER = -50
- global count AS INTEGER = 24
- seedx#(0) = cx
- seedy#(0) = cy
- seeda#(0) = 90
- make camera 1
- position camera 0,0,-100
- backdrop ON
- color backdrop 1,rgb(0,0,0)
- make light 1
- position light 1,-40,0,0
- color light 1,rgb(128,0,255)
- DO
- ` process each seed
- FOR n = 0 TO seednum-1
- seedx#(n) = seedx#(n) + COS(seeda#(n)) * grow_distance#
- seedy#(n) = seedy#(n) + SIN(seeda#(n)) * grow_distance#
- time# = TIMER()
- grow_at(seedx#(n), seedy#(n), 2.0 - (obj / 1000.0))
- NEXT
- ` Decrement the child counter
- IF count <= 0
- ` Angle TO spread
- angle# = 15+RND(15)
- `angle# = 30
- ` Create childs
- FOR n = 0 TO seednum-1
- seedx#(n + seednum) = seedx#(n)
- seedy#(n + seednum) = seedy#(n)
- seeda#(n + seednum) = seeda#(n) - angle#
- seeda#(n) = seeda#(n) + angle#
- NEXT n
- seednum = seednum * 2
- ` RESET counter
- count = 8+RND(8)
- ELSE
- count = count - 2
- endif
- SLEEP 60
- set cursor 0, 0
- PRINT "Childs: ", seednum
- PRINT "Objects: ", obj
- sync
- LOOP
- FUNCTION grow_at( x#, y#, siz# )
- make object cube obj, siz#
- position object obj, x#, y#, 80
- IF obj > 255 THEN delete object obj-254
- color object obj,rgb(RND(255),0,0)
- obj = obj + 1
- endfunction
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement