Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
IFS leaf — Gideros Forum

IFS leaf

dr_maxdr_max Member
edited October 2013 in Code snippets
-- just amused)

shape = Shape.new()
shape:setLineStyle(1, 0x00f000)
stage:addChild(shape)

x = 0
y = 0
for i = 1, 30000 do
local r = math.random()
if r < 0.01 then
a = 0
b = 0
c = 0
d = 0.16
e = 0
f = 0
elseif r < 0.8 then
a = 0.85
b = 0.04
c = -0.04
d = 0.85
e = 0
f = 1.6
elseif r < 0.9 then
a = 0.2
b = -0.26
c = 0.23
d = 0.22
e = 0
f = 1.6
elseif r < 1 then
a = -0.15
b = 0.28
c = 0.26
d = 0.24
e = 0
f = 0.44
end

x1 = (a * x) + (b * y) + e
y1 = (c * x) + (d * y) + f
x = x1
y = y1
shape:beginPath()
shape:moveTo(x*80+200,y*80)
shape:lineTo(x*80+201,y*80)
shape:endPath()
end

Likes: talis, phongtt

+1 -1 (+2 / -0 )Share on Facebook

Comments

Sign In or Register to comment.