Loop help
4 posts • Page 1 of 1
Loop help
I'm making a bomb with a laser as timer. If the controllerAcc comes to 0, the bomb with explode. I've made a script to spawn the "explosion". But he spawns only 2 circles!
Here's the script:
PS: I will upload the scene later on.
Here's the script:
- Code: Select all
(e)=>{
e.geom.controllerAcc = e.geom.controllerAcc - 0.05;
e.geom.controllerAcc <= 0 ? {
for(10, {
Scene.addCircle({
pos := e.pos;
radius := 0.1;
color := [1, 0, 0, 1];
drawCake := false
})
});
e.geom.density = 0
} : {}
}
PS: I will upload the scene later on.
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
-
Matten - Posts: 435
- Joined: Mon Apr 05, 2010 2:03 pm
- Location: The Netherlands
Re: Loop help
- Code: Select all
(e)=>{
e.geom.controllerAcc = e.geom.controllerAcc - 0.05;
e.geom.controllerAcc <= 0 ? {
for(10,(i)=>{
Scene.addCircle({
pos := e.pos;
radius := 0.1;
color := [1, 0, 0, 1];
drawCake := false
})
});
e.geom.density = 0
} : {}
}
make sure to check out my work.
-
Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Loop help
Damn, totally forgot the (x)=>!
I thought already that I missed something, but I didn't knew what. Thanks!
I thought already that I missed something, but I didn't knew what. Thanks!
Cave Johnson wrote:Do you know who I am? I'm the man who's gonna burn your house down! With the lemons! I'm gonna get my engineers to invent a combustible lemon that burns your house down!
-
Matten - Posts: 435
- Joined: Mon Apr 05, 2010 2:03 pm
- Location: The Netherlands
4 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests