Posted: Fri Jan 23, 2004 4:32 pm Post subject: explosion help
Im trying to make something explode for my school project but i dont know how to get a whole bunch of particles to go out in different directions at the sametime after I have drawn them. I had the same problem with a cloud program i was doing. I drew the cloud with a whole bunch of dots and I want all of the dots to move seperately but I didnt know how and i ended up moving the cloud with Pic.Draw . If ne one could give me a code and explain how they did it it would be very helpful
Sponsor Sponsor
Tony
Posted: Fri Jan 23, 2004 5:01 pm Post subject: (No subject)
there's a number of particle engines available... you just make a radial push force in the center of explosion
Posted: Fri Jan 23, 2004 5:08 pm Post subject: (No subject)
lol. I would like to know what I am doing so i can use it in different situations. all of the particle programs seem to have "type" and "record" in the beginning of the program. What do these mean?
Cervantes
Posted: Fri Jan 23, 2004 5:09 pm Post subject: (No subject)
ooh ooh! if you can't do it in Turing then you can always draw a series of pictures in Paint of your thing exploding and then import those into Turing
Schaef
Posted: Fri Jan 23, 2004 5:10 pm Post subject: (No subject)
i could.. but that would suck . lol. could someone just plz post a code and tell me how it works?
Sponsor Sponsor
Cervantes
Posted: Fri Jan 23, 2004 5:11 pm Post subject: (No subject)
I would but I don't know how to do it either
Schaef
Posted: Fri Jan 23, 2004 5:19 pm Post subject: (No subject)
lol. does ne one know how i could do it. I can make all of the little dots put then I cannot change the x and y values for each of them because if i do something like:
var x,y:int
for dots:1..1000
randint (x,100,200)
randint (y,200,300)
drawdot(x,y,16)
end for
could i move all of the dots in different directions instead of just taking a picture of the screen and moving the whole thing?
Schaef
Posted: Fri Jan 23, 2004 6:03 pm Post subject: (No subject)
can someone plz post an example for me?
AsianSensation
Posted: Fri Jan 23, 2004 6:06 pm Post subject: (No subject)
you should have searched.
here is Catalyst's code:
code:
setscreen ("offscreenonly,graphics:640;640")
randomize
const numP := 800
const accel := 0.8
const maxLife := 510
var clr : int
for i : 1 .. 255
clr := RGB.AddColor (1, i / 256, 0)
end for
drawfilloval (maxx div 2, maxy div 2 + 100, 10, 10, black)
drawfillbox (maxx div 2-2,maxy div 2+110,maxx div 2+2,maxy div 2+115,black)
drawline (maxx div 2,maxy div 2+115,maxx div 2,maxy div 2+125,15)
drawfilloval (maxx div 2,maxy div 2+125,2,2,42)
delay (1500)
type part :
record
x : real
y : real
xV : real
yV : real
r : int
life : int
end record
var main : array 1 .. numP of part
var a : array 1 .. numP of int
for i : 1 .. numP
main (i).x := maxx div 2
main (i).y := maxy div 2 + 100
main (i).xV := Rand.Int (-40, 40) * Rand.Real
main (i).yV := Rand.Int (-40, 41) * Rand.Real
main (i).r := Rand.Int (1, 8)
main (i).life := maxLife + Rand.Int (-100, 0)
a (i) := Rand.Int (28, 31)
end for
loop
for i : 1 .. numP
main (i).xV -= main (i).xV / 16
main (i).yV -= accel + main (i).yV / 16
main (i).x += main (i).xV
main (i).y += main (i).yV
main (i).life -= 10
if main (i).life >= 255 then
drawfilloval (round (main (i).x), round (main (i).y), main (i).r, main (i).r, round (((main (i).life / maxLife) * 255) + 255))
else
drawfilloval (round (main (i).x), round (main (i).y), main (i).r, main (i).r, a (i))
end if
end for
View.Update
cls
end loop
Schaef
Posted: Fri Jan 23, 2004 6:08 pm Post subject: (No subject)
ya i did search. I found that one. I am just not sure how "type" and "record" commands work..
AsianSensation
Posted: Fri Jan 23, 2004 6:12 pm Post subject: (No subject)