Increase size of a spawned tracer + making it fade away
7 posts • Page 1 of 1
Increase size of a spawned tracer + making it fade away
Hello. I'm making a bomb were I need to spawn a tracer on a small ball and after that keep the tracer increasing and dading at the same time to give it a shockwave effect. I've tried to reengineer Davidz Howitzer but unsuccessful. I didn't understand how tha code worked and I hate borrowing other scene's codes. Hope You can help me
-Johan
-Johan
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Increase size of a spawned tracer + making it fade away
Rideg wrote:Hello. I'm making a bomb were I need to spawn a tracer on a small ball and after that keep the tracer increasing and dading at the same time to give it a shockwave effect. I've tried to reengineer Davidz Howitzer but unsuccessful. I didn't understand how tha code worked and I hate borrowing other scene's codes. Hope You can help me
-Johan
- Code: Select all
Scene.my.addSmoke := (sPos, sSize, sColor, sTime)=>{geval("scene.addCircle({pos := " + sPos + "; radius := .1; color := [0,0,0,0]; drawCake := false; collideSet := 0; drawBorder := false; density := {sim.time > " + sim.time + "+" + sTime + " ? 0 : 0.005}}); scene.addPen({pos := " + sPos + "; fadeTime := 0; color := {" + sColor + " - [0,0,0," + sColor(3) + "*(sim.time - " + sim.time + ")/" + sTime + "]} ; size := {0.01+" + sSize + " * (sim.time - " + sim.time + ")/" + sTime + "}}) ")};
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: Increase size of a spawned tracer + making it fade away
I couldn't get it to work. Could you write me a tutorial? 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Increase size of a spawned tracer + making it fade away
Rideg wrote:I couldn't get it to work. Could you write me a tutorial?
1. Get last Algodoo.
2. copy code
3. paste code in console and press enter
4. call scene.my.addSmoke(position, max_size, color, fade_time) from your script or console.
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: Increase size of a spawned tracer + making it fade away
Is it possible to make it without any scene.my.* variables 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
Re: Increase size of a spawned tracer + making it fade away
Rideg wrote:Is it possible to make it without any scene.my.* variables
Sure, just pick my code, replace variables and insert in your events.
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: Increase size of a spawned tracer + making it fade away
Okay great. Thank you very much 
-

Rideg - Posts: 948
- Joined: Tue Dec 15, 2009 5:17 pm
- Location: Östersund, Sweden
7 posts • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 10 guests




