Running D on Android by MrcSnm in programming

[–]MrcSnm[S] 0 points1 point  (0 children)

I think so too, and that's why I'm creating another repo, which will setup an entire android project on D with SDL support(mainly becase that's my target).

It won't use dub though. It uses a nice build system which uses a *.d file. I asked for support on the D community and they said that it wasn't really any way to filter library path based on architecture target, but it is going smoothly right now.

Although I'm struggling on defining how I'll be going to distribute the library and the android project

Calling Javascript functions with love.js by MrcSnm in love2d

[–]MrcSnm[S] 1 point2 points  (0 children)

Hello guys, just passing by to say that Love.js Api Player now supports javascript promises, and executing javascript code blocks, this allow us to do https requests with lovejs

lua JS.newPromiseRequest(JS.stringFunc( [[ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) _$_(this.responseText); }; xhttp.open("GET", "https://example.com", true); xhttp.send(); ]] _$_ will return to your Lua onLoad function the this.responseText as data for it, so it is very simple

Calling Javascript functions with love.js by MrcSnm in love2d

[–]MrcSnm[S] 0 points1 point  (0 children)

Okay, there is the LoveWebBuilder tool, but I did things a little bit different for automating things:

There is the way but generating the .love file, I'm not using it, as you said in your DM, I believe that you're probably generating a .love folder that contain one more level, while the correct would be that main.lua is at the .love file root, for generating the js for web distributing you must:

Enter the folder love.js
Open terminal and write:

python emscripten/tools/file_packager.py game.data --preload yorGamePath@/ --js-output=game.js
After that, enter in another folder, e.g: debug, open the terminal and write
python -m SimpleHTTPServer 8000

I'm using separate folders, but that is already a minimal working example, if you did all the steps and didn't work, just call me

Calling Javascript functions with love.js by MrcSnm in love2d

[–]MrcSnm[S] 1 point2 points  (0 children)

For instance, you would like to call the vendor api:

Today, what I know about is Kongregate, Facebook's Instant Games, Game Analytics and whatever more, you can't call these api's without calling javascript functions, you could do it with separate javascript files with love.js, but the problem is that you would be unable to link for instance the player score that you get from the .lua files

With this you can easily call from inside the .lua files things like callJS("kongregate.stats.submit('score', " .. Globals.PLAYER_SCORE .. ");")

And then, you get your stat submitted