Growing things :D And "If" thyme

About advanced scenes, and the Thyme scripting language used in Algodoo.

Growing things :D And "If" thyme

Postby Somtaaw Kith » Sat Oct 08, 2011 3:20 pm

Hey i need some help. I'd like to make missile, i mean when it's hit it's spawning small circle which is growing. From (for ex.) size= 0.25 to size= 10 and then when it reach size=10 ist disappeared (for ex. by density= 0).


Also i'd like to know something about thyme "If". I have found something like this
"scene.my.x > 10 ? scene.my.y : scene.my.z" and this "onhutbylaser(e)=>{scene.my.x=scene.my.x + 1 ? ...}"
about second i know that is laser hits scene.my.x is growing but when i try to thyme after "?" for ex. {density=0} ist correct it to "scene.my.x=scene.my.x + 1 (?)({density=0}) ???






please explain simple rule of thumb, and soon you will see automatic flying machine of doom :D :D :D :D :D :D :D :D
Somtaaw Kith
 
Posts: 5
Joined: Thu Jul 28, 2011 1:57 pm

Re: Growing things :D And "If" thyme

Postby electronicboy » Sat Oct 08, 2011 5:07 pm

Not sure of what to do exactly, but the only way of making circles "grow",
is to spawn a circle, delete that, and respawn a bigger one...


as for if scripts,

condition ? {TRUE} : {FALSE}
When asking for help, READ THE STICKIES!
electronicboy
 
Posts: 1694
Joined: Mon Aug 31, 2009 6:18 pm

Re: Growing things :D And "If" thyme

Postby Somtaaw Kith » Sat Oct 08, 2011 5:26 pm

i got about IF... but about growing i saw scene where you fly airplane and shoot missiles when its hit its makeing BOOM effect and "sonic wave" (circle) is growing
Somtaaw Kith
 
Posts: 5
Joined: Thu Jul 28, 2011 1:57 pm

Re: Growing things :D And "If" thyme

Postby Kilinich » Sat Oct 08, 2011 5:59 pm

Following code define a function for creating fading away growing tracers:

Code: Select all
Scene.my.addSmoke := (sPos, sSize, sColor, sTime)=>{geval("scene.addCircle({geomID := 13; 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 + "]}; zdepth = 4;  geom=13; size := {2+" + sSize + " * (sim.time - " + sim.time + ")/" + sTime + "}}) ")};
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Growing things :D And "If" thyme

Postby Kilinich » Sat Oct 08, 2011 6:44 pm

adjust zdepth, density or add vel as you wish...
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Growing things :D And "If" thyme

Postby Somtaaw Kith » Sat Oct 08, 2011 7:08 pm

Holy S**t nice... now i must understand what have u wrote :D:D
Somtaaw Kith
 
Posts: 5
Joined: Thu Jul 28, 2011 1:57 pm

Re: Growing things :D And "If" thyme

Postby Somtaaw Kith » Sat Oct 08, 2011 7:51 pm

Aha. one question more.. how 2 make that missile will change angle of shot i mean missile will respawn with angle for ex. 180 and when i turn missile launcher to difffrent position it will spawn with angle of laucher.. :D:D
Somtaaw Kith
 
Posts: 5
Joined: Thu Jul 28, 2011 1:57 pm

Re: Growing things :D And "If" thyme

Postby Kilinich » Sun Oct 09, 2011 10:31 am

Please search forum, it's a faq.
Dream of Algodoo as game development engine...
User avatar
Kilinich
[Best bug reporter 2010]
 
Posts: 2098
Joined: Mon Aug 31, 2009 8:27 pm
Location: South Russia

Re: Growing things :D And "If" thyme

Postby Somtaaw Kith » Sun Oct 09, 2011 7:02 pm

ok
Somtaaw Kith
 
Posts: 5
Joined: Thu Jul 28, 2011 1:57 pm


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 4 guests