clockworkPi

How to create a game using JavaScript?

javascript

#1

How to do a Hello World Game using JavaScript? Some dev tools? framework, sdk?


#2

Have a look at phaser, nice little framework for creating 2D games. For dev tools I can highly recommend vscode. It has great support for JavaScript and node.js


#3

+1 for phaser.

I got some older prototypes made with phaser which I’d like to test on the Gameshell, but I don’t really know where to start. I got a HTML file plus some JS assets and images. How should those be loaded?
Launch a web browser from the launcher and load the local HTML file?
Wrap it with electron?
Any other ideas?


#4

Oh right, forgot about that part… maybe try NW.js not sure if you can get it running on an ARM platform though

Edit: apparently you can link


#5

That could be an alternative to electron - I just checked Github, electron is available for ARM, too. One of these two (or both) might work. I’ll try to play around with that when I have some tim.


#6

Thanks! I could do It :slight_smile:


#7

NIce! Feel like creating a tutorial so other people can follow along?
Oh and do you have any clue as to the performance of running JS on GS? NW.js sorta runs a browser under the hood to display your html canvas, so it’s not quite light-weight…


#8

Please provide a tutorial or repo of a sample app, this would be very helpful. I’ve tried different things with electron and nw.js but had no luck at all so far :confused:


#9

Have you tried this? It’s not Electron, just nw.js and Phaser, but will hopefully get you somewhere!


#10

Nice, thank you for the hint! I’ve managed to run nwjs by myself now, the missing piece was libnss3. Anyway, for phaser this will be helpful!

nwjs running with default sample app :slight_smile:
nwjs_01