Stack Overflow
5 posts • Page 1 of 1
Stack Overflow
- Code: Select all
n=180;
for(2*n,(i)=>{
Scene.addCircle({
attractionType := 1;
attraction := 1.00000000;
friction := 0.00000000;
color := [0, 0, 0, 1];
drawCake := false;
pos := [2*math.sin(math.pi/n*i), 2*math.cos(math.pi/n*i)];
onDie := (e)=>{};
density := 2.0000000;
radius := 0.015625000;
angvel := 0.00000000;
heteroCollide := false;
glued := true;
onKey := (e)=>{};
opaqueBorders := true;
body := 0;
edgeBlur := 0.00000000;
zDepth := 4.0000000;
layer := 0
})})
for2=(b,n,f)=>{
n<2?{
n<1?{
f(b)
}:0
}:{
t=math.toint(n);
for2(b,t,f);
for2(b+t,n-t,f);
}
};
but only one circle was drawed
- l4m2
- Posts: 42
- Joined: Fri Jun 27, 2014 6:21 am
Re: Stack Overflow
Although this code is okay, not the same way as easier thinking
- Code: Select all
Scene.addCircle({
pos:=[0,0];
radius:=1;
collideset:=0;
collidewater:=false;
friction:=0;
update:=(e)=>{
n=180;
i = friction;
friction>=2*n ? {
timetolive = -1
} : {
Scene.addCircle({
attractionType := 1;
attraction := 1.00000000;
friction := 0.00000000;
color := [0, 0, 0, 1];
drawCake := false;
pos := [2*math.sin(math.pi/n*i), 2*math.cos(math.pi/n*i)];
onDie := (e)=>{};
density := 2.0000000;
radius := 0.015625000;
angvel := 0.00000000;
heteroCollide := false;
glued := true;
opaqueBorders := true;
body := 0;
edgeBlur := 0.00000000;
zDepth := 4.0000000;
layer := 0
})
};
friction=friction+1;
}
})
- l4m2
- Posts: 42
- Joined: Fri Jun 27, 2014 6:21 am
Re: Stack Overflow
I don't know why, I can't seem to get more than 65~~ runs of the code thing either. I just usually make it spawn objects that spawn more objects.
.
-
icrls984 - Posts: 80
- Joined: Thu Jun 13, 2013 6:33 am
Re: Stack Overflow
Dream of Algodoo as game development engine...
-
Kilinich - [Best bug reporter 2010]
- Posts: 2098
- Joined: Mon Aug 31, 2009 8:27 pm
- Location: South Russia
Re: Stack Overflow
Two places modified:
But when run it dies for a time
- Code: Select all
for2=(b,n,f)=>{n<2?{n>0?{f(b)}:0}:{t=math.toint(n/2);for2(b,t,f);for2(b+t,n-t,f);}};
But when run it dies for a time
- l4m2
- Posts: 42
- Joined: Fri Jun 27, 2014 6:21 am
5 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 15 guests