For a while, GameSalad has also supported Cordova. Exporting to HTML would also produce the files to support Cordova integration. But since I didn’t know of any way to communicate with the engine this integration had limited use and very little benefits over just exporting to the target native application.
This all changed recently. As some of you might know GameSalad for the first time that I am aware of either introduced or documented how to communicate with the engine after the game has been exported as HTML5.
I don’t represent GameSalad in any way but I believe this was done to support their new partner Legends of Learning. If you have kids that need some extra help especially now that they are at home, I would recommend checking their products. Anybody that supports GameSalad should also be supported.
This series of blog posts and youtube videos will try to document my journey as I try to discover and integrate functionality through Cordova that I always wanted in GameSalad. I only have a really old mac so if you are on a PC, I don’t know know how much this series would be helpful.
So here we go:
- Followed the steps to get Cordova installed. For the create platform step, I said I wanted to create an iOS app:
-
$ cordova platform add ios
-
- I exported my game from the GameSalad portal. For this project, I am using the game that I created for the “repair” game jam. The game, project, and export are already available in multiple places including itch.io.
- From the export, I copied everything into the Cordova project under platforms -> ios -> www.
- I renamed the Cordova HTML file to index.html. In the end, your folder should look like this:
- I then moved all the useful tidbits from the sample sample-legendsoflearning.html file to the cordova-app.js (<- attached here) file inside the js folder. I remove all the references to the LoL library since Cordova won’t have those. For now, most of the functions are blank, I’ll fill those up as I work on the integration.
- As the final step, I fired off Xcode and make sure that the project still runs.
That is all I did yesterday. Questions or comments let me know.