🤑 Indie game store🙌 Free games😂 Fun games😨 Horror games
👷 Game development🎨 Assets📚 Comics
🎉 Sales🎁 Bundles

Plugins require too much configuration

A topic by carterza created 1 year ago Views: 278 Replies: 4
Viewing posts 1 to 4
(Edited 3 times)

I really want to like superpowers for JS game development - I think it beats the pants of phaser even though I love the renderer phaser relies on.

The sad truth is though, I will be probably using libgdx for developing a cross platform game at this point. I really wanted to use some third party javascript libs in my project, however it seems in order to do so I have to create a plugin - which requires creating typescript bindings etc. I understand the necessity of this based on the architecture of the platform, but it's a lot simpler just to update a POM/Gradle file. Hell I have an easier time creating cmake builds than I do creating typescript plugins for superpowers.

If you guys could streamline / automate this I'd probably give the platform another shot.

Moderator(+2)

Someone is already creating a plugin which allow you to install a library through npm directly from a project to make this simpler!

github.com/antca/superpowers-package-manager-plugin
We haven't tested it much yet but we saw some feedback saying it's working fine!

(Edited 3 times) (+3)

Depending on the library and how it works, I think you can just add its code to one of you Script asset.

You can also just make a link to the library hosted somewhere with a <script> tag then create the variable from your scripts :

// create the link to you lib
declare const window; const link = window.document.createElement("script"); link.src = "http://the link to your lib"; window.document.body.appendChild(link); // create the lib for you scripts to use
const theLib: any;

Until further notice, you only need a plugin to add Typescript definitions, which are not mandatory (but definitely nice to have).

(Edited 1 time) (+1)

Hey Florent, I want to say that the linking-to-library solution is fantastic! It works perfectly for externally hosted scripts and makes using external libraries much more convenient.

I was wondering if there was a way to link to a local script in a similar way, ideally to a file within the project directory? Just for the option of being able to play/test the game offline, or as a standalone once it's published.

I also tried placing it in `Superpowers/Contents/Resources/system/game/`, but I get an error with the GET request even though that looks like it should be the right directory to place it in.

Thanks!

EDIT: Actually, I just tried publishing the game and then placing the scripts in the root directory of the output folder, and that worked!

(+1)

Thank you both for this info - back to superpowers!