|
| 18 Dec 2013 03:32 PM |
function drawLightning(x1,y1,x2,y2,displace) { if (displace < curDetail) { graf.moveTo(x1,y1); graf.lineTo(x2,y2); } else { var mid_x = (x2+x1)/2; var mid_y = (y2+y1)/2; mid_x += (Math.random()-.5)*displace; mid_y += (Math.random()-.5)*displace; drawLightning(x1,y1,mid_x,mid_y,displace/2); drawLightning(x2,y2,mid_x,mid_y,displace/2); } } |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
| |
|
|
| 18 Dec 2013 03:58 PM |
This looks to be C or PHP or maybe even Java or JavaScript.. basically, it can be any number of languages but Lua.. the Lua version of this script would be:
function drawLightning(x1,y1,x2,y2,displace) if displace < curDetail then graf.moveTo(x1,y1) graf.lineTo(x2,y2) else var mid_x = (x2+x1)/2 var mid_y = (y2+y1)/2 mid_x = mid_x + (math.random()-.5)*displace mid_y = mid_y + (math.random()-.5)*displace drawLightning(x1,y1,mid_x,mid_y,displace/2) drawLightning(x2,y2,mid_x,mid_y,displace/2) end end |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 03:59 PM |
That is not JavaScript or PHP. I known both of those very well. |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
| |
|
shonclub
|
  |
| Joined: 05 Sep 2009 |
| Total Posts: 1331 |
|
| |
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 18 Dec 2013 04:00 PM |
| Also, it's definitely not C either. |
|
|
| Report Abuse |
|
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 18 Dec 2013 04:01 PM |
| My guess would be JavaScript. It's definitely not C or C++ because they don't use 'function' when creating a function. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 04:02 PM |
| @TheBlackCloth: I know both very well aswell, I've created my own website, I currently have a PHP based server used with roblox's new HttpService to make cross-server chat possible, I know them all very well, and this could easily be PHP for sure if it were to be set up correctly.. |
|
|
| Report Abuse |
|
|
MXrcr20
|
  |
| Joined: 01 Oct 2008 |
| Total Posts: 2644 |
|
|
| 18 Dec 2013 04:02 PM |
| But I'm most likely wrong to say it's JavaScript. |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Dec 2013 10:36 PM |
| I got it off a website, its suppost to generate a lighting bolt |
|
|
| Report Abuse |
|
|
Madified
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 5292 |
|
| |
|
|
| 18 Dec 2013 10:44 PM |
| I think it may actually be PHP or some website code but idk |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 10:49 PM |
| PHP does require ; inbetween lines, I'm fairly sure it's PHP just by how it's lain out and how it acts with stuff, though it actually could be a good number of different languages.. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 10:51 PM |
Madified...
Lua uses ; AS3 uses ; C++ uses ; Java uses ;
What. |
|
|
| Report Abuse |
|
|
Zachiah
|
  |
| Joined: 27 Oct 2013 |
| Total Posts: 1401 |
|
|
| 18 Dec 2013 10:54 PM |
It is obviously JavaScript.
PHP does not have the Math.random function, JavaScript does.
To define variables in PHP you use an '$' at the beginning, this uses 'var' which is used in JavaScript.
Why is this so hard? |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 11:06 PM |
| Zach, that is the exact reason I said it was JavaScript. |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 11:08 PM |
| PiggyJingles, Javascript and PHP also use ; |
|
|
| Report Abuse |
|
|
Madified
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 5292 |
|
| |
|
|
| 18 Dec 2013 11:21 PM |
| You must not know many programming languages. |
|
|
| Report Abuse |
|
|
Madified
|
  |
| Joined: 19 Apr 2011 |
| Total Posts: 5292 |
|
| |
|
Infocus
|
  |
| Joined: 28 Apr 2011 |
| Total Posts: 8022 |
|
|
| 18 Dec 2013 11:29 PM |
| I have a lightning function that you can use |
|
|
| Report Abuse |
|
|
|
| 18 Dec 2013 11:31 PM |
| I got one infocus, but thanks |
|
|
| Report Abuse |
|
|