Can anyone help me make lighning?
Author |
Message |
bharath1000
|
Posted: Wed Nov 30, 2011 9:43 am Post subject: Can anyone help me make lighning? |
|
|
can you help me make actual lightning coming from the sky because i can't quite seem to be able to do it =(. its to make my program look more scary =) |
|
|
|
|
 |
Sponsor Sponsor

|
|
 |
evildaddy911
|
Posted: Wed Nov 30, 2011 11:06 am Post subject: RE:Can anyone help me make lighning? |
|
|
i suggest drawing lines from a random point A to a random point B, or making a procedure dawing lines in a zigzag shape then using drawfill to color them in. 1 frame would make sense for each bolt, then a "reload" vaiable telling the computer when it can draw the next bolt
Eg (number 1)
Turing: | var reload: int:=Rand.Int (2, 10)
loop
reload-= 1
if reload= 0 then
reload:=Rand.Int (2, 10)
drawline(Rand.Int (0, maxx), maxy,Rand.Int (0, maxx), 0, yellow)
end if
delay(40)
end loop |
Eg (number 2)
Turing: | var lastx,lasty,x,y: int
proc lightning
randomize
drawline(Rand.Int (0, maxx), maxy,x,y, yellow)
for i: 1..Rand.Int (2, 5)
lastx:=x
lasty:=y
x:=Rand.Int (0, maxx)
y:=Rand.Int (0, maxy)
drawline(lastx,lasty,x,y, yellow)
end for
end lightning |
try someting like that |
|
|
|
|
 |
bharath1000
|
Posted: Wed Nov 30, 2011 7:58 pm Post subject: RE:Can anyone help me make lighning? |
|
|
thanks =D, btw the second example displays nothing |
|
|
|
|
 |
SoulMaker
|
Posted: Wed Nov 30, 2011 8:29 pm Post subject: RE:Can anyone help me make lighning? |
|
|
Guys ignore this blog, the guy just want you to do his school project for him ..
Stop helping him!!! XD |
|
|
|
|
 |
evildaddy911
|
Posted: Thu Dec 01, 2011 11:16 am Post subject: RE:Can anyone help me make lighning? |
|
|
bharath, the second example is just to demonstrate how one could go about it, youll have to figure out how to finish it... also, I only gave you a procedure, you have to actually call in the procedure.
if you want to make the lightning seem realistic, make a thunder sound effect that plays when the lightning flashes... look at the turorials |
|
|
|
|
 |
|
|