2DWorlds Forums
Gah, stupid lightning - Printable Version

+- 2DWorlds Forums (http://2dworlds.buildism.net/forum)
+-- Forum: 2DWorlds (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=4)
+--- Forum: 2DWorlds Discussion (http://2dworlds.buildism.net/forum/forumdisplay.php?fid=10)
+--- Thread: Gah, stupid lightning (/showthread.php?tid=2763)

Pages: 1 2


RE: Gah, stupid lightning - Micky - 04-10-2011

Dont take it bad, but i love rain, its so calming!!!


RE: Gah, stupid lightning - Ice - 04-10-2011

OMG, I love rain even more...so peaceful


RE: Gah, stupid lightning - Twinmold - 04-10-2011

I <3 storms. Just as long as it's not a snowstorm. God, i'm so sick of those.


RE: Gah, stupid lightning - Ashely - 04-10-2011

(04-10-2011, 05:20 AM)Twinmold Wrote: I <3 storms. Just as long as it's not a snowstorm. God, i'm so sick of those.

I couldn't agree with you more, Im sick and tired of the cold period.


RE: Gah, stupid lightning - toast - 04-10-2011

[/lua]
(04-10-2011, 05:15 AM)Scripter Wrote:
(04-10-2011, 05:14 AM)toast Wrote: Nu you have to make lightning out of yellow Boxes so it's randomer and more realistic

xD

But, if you're going to have a lot of lightning strikes...THAT WILL BE A LOT OF MATH THAT I DON'T KNOW HOW TO DO.

What you do is you choose the X that the lightning will strike at, then you choose how many points there are, then you keep making points at X + randomnumberhere so that way it's random, then you make a function for making parts that are a line from one place to another (this might work)
[lua]function line(from,to,thickness)
local p=create("Box")
p.Position=from:add(to):divide(2)
p.Size=Vec2D((from.x^2+from.y^2)^0.5,thickness)
p.Rotation=math.atan2(from.y-to.y,from.x-to.x)
return p [/lua]
I think the atan2 is screwed up but oh well