self fading & deleting object -> bug?
7 posts • Page 1 of 1
self fading & deleting object -> bug?
i create a circle on laserhit:
Scene.addCircle {
collideWater := false;
color := {[0.43, 0.322, 0.366, 1 - ((sim.time - controllerAcc) / 10)]};
drawCake := false;
controllerAcc := Sim.time;
collideSet := 0;
zDepth := 6.0;
pos := e.pos;
angle := -0.6313785;
radius := 0.25;
density := {(sim.time - controllerAcc) < 10 ? {2.0} : {NaN}}
}
this only works for 1 circle at a time.. -> when i spawn 10 circles with a laser like this in a row, only the first will fade and delete itself, why?
Scene.addCircle {
collideWater := false;
color := {[0.43, 0.322, 0.366, 1 - ((sim.time - controllerAcc) / 10)]};
drawCake := false;
controllerAcc := Sim.time;
collideSet := 0;
zDepth := 6.0;
pos := e.pos;
angle := -0.6313785;
radius := 0.25;
density := {(sim.time - controllerAcc) < 10 ? {2.0} : {NaN}}
}
this only works for 1 circle at a time.. -> when i spawn 10 circles with a laser like this in a row, only the first will fade and delete itself, why?
- pixartist
- Posts: 65
- Joined: Wed Sep 02, 2009 5:30 pm
Re: self fading & deleting object -> bug?
I wish this worked, and I tryed the same thing.
Dynamic Color Changing
Read this, it gets around it a little, but you cant read off a variable in the spawned object.
Dynamic Color Changing
Read this, it gets around it a little, but you cant read off a variable in the spawned object.
-
Versieon - Posts: 375
- Joined: Tue Sep 01, 2009 4:45 pm
Re: self fading & deleting object -> bug?
does this mean, that a spawned object can only have one dynamic variable ?
- pixartist
- Posts: 65
- Joined: Wed Sep 02, 2009 5:30 pm
Re: self fading & deleting object -> bug?
pixartist wrote:i create a circle on laserhit:
Scene.addCircle {
collideWater := false;
color := {[0.43, 0.322, 0.366, 1 - ((sim.time - controllerAcc) / 10)]};
drawCake := false;
controllerAcc := Sim.time;
collideSet := 0;
zDepth := 6.0;
pos := e.pos;
angle := -0.6313785;
radius := 0.25;
density := {(sim.time - controllerAcc) < 10 ? {2.0} : {NaN}}
}
this only works for 1 circle at a time.. -> when i spawn 10 circles with a laser like this in a row, only the first will fade and delete itself, why?
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: self fading & deleting object -> bug?
Kilinich wrote:pixartist wrote:i create a circle on laserhit:
Scene.addCircle {
collideWater := false;
color := {[0.43, 0.322, 0.366, 1 - ((sim.time - controllerAcc) / 10)]};
drawCake := false;
controllerAcc := Sim.time;
collideSet := 0;
zDepth := 6.0;
pos := e.pos;
angle := -0.6313785;
radius := 0.25;
density := {(sim.time - controllerAcc) < 10 ? {2.0} : {NaN}}
}
this only works for 1 circle at a time.. -> when i spawn 10 circles with a laser like this in a row, only the first will fade and delete itself, why?
thats exactly what i did isnt it ? where is the difference?
edit: doesnt work if you spawn a lot of objects in a row
- pixartist
- Posts: 65
- Joined: Wed Sep 02, 2009 5:30 pm
Re: self fading & deleting object -> bug?
kilinich, i actually found a way!!!
on the spawner:
this can spawn self-modifying objects at any rate !! IMMA GEENIAS!!
it replaces the script on the spawner everytime an object is created...!
- Code: Select all
Scene.my.spawnball := (e)=>{scene.addcircle({ pos := e.pos; mark := sim.time; color := {[1, 1, 1, 1 / (1 + 2 * (sim.time - mark))]}; density := {(sim.time > (mark + 1)) ? NaN : 0.005}; collideset := 0; drawborder := false; drawcake := false }); onCollide = (e)=>{e.other.color = [0, 0, 0, e.other.color(3) / 2]; (e.other.color(3) < 0.1) ? { e.other.liquify; scene.erasewater } : {}; Scene.my.spawnball(e)}}
on the spawner:
- Code: Select all
(e)=>{
e.other.color = [0, 0, 0, e.other.color(3) / 2]; (e.other.color(3) < 0.1) ? { e.other.liquify; scene.erasewater } : {}; Scene.my.spawnball(e) }
this can spawn self-modifying objects at any rate !! IMMA GEENIAS!!
it replaces the script on the spawner everytime an object is created...!
- pixartist
- Posts: 65
- Joined: Wed Sep 02, 2009 5:30 pm
Re: self fading & deleting object -> bug?
pixartist wrote:kilinich, i actually found a way!!!
this can spawn self-modifying objects at any rate !! IMMA GEENIAS!!
it replaces the script on the spawner everytime an object is created...!
Wow that's actually awesome
-
KarateBrot - Posts: 825
- Joined: Mon Aug 31, 2009 7:32 pm
- Location: Germany
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 8 guests