ghoulsblade / love-webplayer

WebPlayer for Love2D engine games (webgl+javascript)
http://ghoulsblade.schattenkind.net/wiki/index.php/Love-WebPlayer
zlib License
241 stars 33 forks source link

Single file / require #12

Open kikito opened 12 years ago

kikito commented 12 years ago

Hi,

I think requiring the files like this just doesn't cut it:

<script type="text/javascript" src="../js/lua-parser.js"        ></script>
<script type="text/javascript" src="../js/lua-parser-utils.js"  ></script>
<script type="text/javascript" src="../js/gamepad.js"      ></script>
<script type="text/javascript" src="../js/jquery.js"      ></script>
<script type="text/javascript" src="../js/jquery.hotkeys.js"      ></script>
<script type="text/javascript" src="../js/utils.js"         ></script>
<script type="text/javascript" src="../js/utils.webgl.js"       ></script>
<script type="text/javascript" src="../js/love.render.js"       ></script>
<script type="text/javascript" src="../js/main.js"          ></script>
...

I see two options:

josefnpat commented 12 years ago

If you're ok with moving away from a pure JS implementation by using some php, you can check out the index.php I commited a long while back;

https://github.com/ghoulsblade/love-webplayer/blob/master/index.php

You'll notice it builds this section automatically,

Although I personally thing an auto-detecting JS would be a lot better.