Spawn lots of circles with different parameters
3 posts • Page 1 of 1
Spawn lots of circles with different parameters
I've been into programming for quite some time. I took a break for about a year, and I wanted to get back into it. I didn't want to get into anything TOO serious (as in huge scripts like Java or something) and I remembered all the fun I had with Phun.
Needless to say, I came back to it. (Or, Algodoo anyways.)
So here's what I got so far...
Now here's what I want it to do...
Now, I KNOW that's not right. Can anyone correct me, please?
Needless to say, I came back to it. (Or, Algodoo anyways.)
So here's what I got so far...
- Code: Select all
(e)=>{
scene.addCircle({
radius := 0.1;
pos := e.pos;
vel = [50, 50];
});
scene.addCircle({
radius := 0.1;
pos := e.pos;
vel = [-50, 50];
e.this.density = 0;
})
}
Now here's what I want it to do...
- Code: Select all
(e)=>{
countX := 50;
countY := 50;
for( 10, (x)=>{
scene.addCircle({
radius := 0.1;
pos := e.pos;
vel = [countX, countY];
countX = countX - 10;
countY = countY + 10;
})
}
}
Now, I KNOW that's not right. Can anyone correct me, please?
- Cindex
- Posts: 1
- Joined: Fri May 14, 2010 8:45 am
Re: Spawn lots of circles with different parameters
- Code: Select all
countX := 50;
countY := 50;
for( 10, (x)=>{
scene.addCircle({
radius := 0.1;
pos := e.pos;
vel := [countX, countY];
})
countX = countX - 10;
countY = countY + 10;
}
or
- Code: Select all
for( 10, (x)=>{
scene.addCircle({
radius := 0.1;
pos := e.pos;
vel := [x*(-10)+50, x*10+50];
})
}
- Mr_Stabby
- Posts: 155
- Joined: Wed Dec 16, 2009 12:16 am
Re: Spawn lots of circles with different parameters
you forgot to use ; between the end of the for function and the count change. the lack of it will cause a script failure
Jrv wrote:TC42 wrote:Quite honestly, I didn't think anyone on 4chan has that good a use of grammar, spelling, usage, mechanics, ect.
But I've never been there, so I may be wrong.
GTFO newfgt
-
RA2lover - Posts: 607
- Joined: Mon Aug 31, 2009 8:43 pm
- Location: Brazil
3 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 7 guests