explosion/bomb

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

explosion/bomb

Postby mold999 » Sun Feb 20, 2011 4:45 am

how can I make a bomb so that when it collides, it explodes and not only destroys the bomb but the explosion slowly fades out? I'm trying to use the script for the bomb: onCollide = (e)=>{scene.addcircle{radius = .1; color = [0,0,0,1]; pos=e.pos} * 8}

for the explosion fade-out, i have no idea what to do. can somebody help me please?
Phundementalism?

Ain't nobody got
thyme fo dat.
User avatar
mold999
 
Posts: 225
Joined: Sun Jan 02, 2011 1:35 am
Location: [176436, 3763234]

Re: explosion/bomb

Postby Someone Else » Sun Feb 20, 2011 6:02 am

All I can think is spawn a laser with 1 maxRays in a partially transparent circle. The laser would be scripted so the circle's density and opacity both decrease slowly over time:
Code: Select all
e.geom.density = e.geom.density - .02;
e.geom.color = [0, 0, 0, e.geom.color(3) - .01]

This way, the circle will become invisible at about the same time its density becomes 0 and auto-deletes.

Then again, I don't know how to spawn a laser.

Or:

Ask Kilinich.
Matthias Wandel is epic, in my humble opinion.
I love my brain...
TC42 wrote:Also, your sig is too big, please change it.

ARE YA HAPPY NOW?????

Thymechanic/Phundamentalist

Recently, I discovered something a lot of you probably already knew: Minecraft is awesome.
Due to this, I may not be as active as usual for a while.
User avatar
Someone Else
 
Posts: 1147
Joined: Sun Nov 21, 2010 10:53 pm
Location: The Milky Way Galaxy

Re: explosion/bomb

Postby Kilinich » Sun Feb 20, 2011 1:03 pm

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: explosion/bomb

Postby mold999 » Mon Feb 21, 2011 7:02 pm

Thanks, Kilinich.
And Someone Else.
Phundementalism?

Ain't nobody got
thyme fo dat.
User avatar
mold999
 
Posts: 225
Joined: Sun Jan 02, 2011 1:35 am
Location: [176436, 3763234]


Return to Thyme scripting

Who is online

Users browsing this forum: No registered users and 2 guests