There was a godot game jam this weekend, before uploading my game here I thought itd be good to figure out how to add newgrounds medals and scoreboards to it. you can check out my game w/ newgrounds api integration here
It was pretty simple, I uploaded the html files to my newgrounds file dump for anyone to use newgrounds-godot.zip
There 3 files, index.html, newgroundsio.js, and ng-integrate.js
- index.html is the html template
- newgroundsio.js is the javascript api wrapper for the newgrounds api
- ng-integrate.js is some of the example code from the newgrounds.io documentation refactored into methods for Godot to call.
Index.html should be set as the custom html shell (red arrow below)
newgroundsio.js and ng-integrate.js should be dropped in the build folder (blue arrow)
Set APP_ID and AES_ENCRYPTION_KEY in ng-integrate.js to your games ID and key.
Once thats done, you can call the api using godot's Javascript singleton.
Make sure you call "initSession" on the handler for a user mouse down input.
Then you call unlock medals and post to scoreboards like so:
hope this helps! feel free to dm me with any questions.
BrandyBuizel
@psychogoldfish should think about putting it on the newgrounds.io website