DEV Community

Cover image for Gaming JavaScript

Gaming JavaScript

K on February 18, 2018

Image by David Werner on Flickr So you're somehow ended up being a web-developer and coding JavaScript and year after year you learn that JavaScr...
Collapse
 
polskais1 profile image
Paul Fielek

The new Cocos Creator engine is also pretty great and supports typescript wonderfully!

Collapse
 
kayis profile image
K

Nice, Phaser also supports TypeScript.

Collapse
 
arnaudmorisset profile image
Arnaud Morisset

Just a comment in order to share a word about CreateJS: createjs.com/

Its creators, GSkinner, made really cool things with it: gskinner.com/showcase

And don't forget the possibility to do those things yourself with WebGL/Canvas and the others available API.

Collapse
 
kurtainz profile image
Kurt Corbett

Phaser is cool, I used it in one of my projects when I was putting together a portfolio to get me my first Dev job. I'd recommend it at any level of JS/programming competency.

Here's what I made:

ufofs.herokuapp.com/

It's a very simple game that didn't take too long to make, but it shows the kind of cool thing you can build. It even has support for mobile/touch based interfaces.

Collapse
 
ky1e_s profile image
Kyle Stephens

Unity Game Engine also supports a JavaScript syntax.

Collapse
 
ky1e_s profile image
Kyle Stephens

It's a JavaScript-like syntax, as opposed to JavaScript run on a JavaScript engine. A familiarity with JS means that you can pick up their script very quickly by referencing their API docs.

It should be noted that Unity is a proprietary engine and the specifications can change at the whim of Unity. The positives are that it comes with a Rich IDE/modelling tool where you can create objects and environments.

As noted by Michael, it's being deprecated this year so maybe best to avoid. :(

Collapse
 
kayis profile image
K

Nice!
Could you elaborate? :D

Collapse
 
homerdalords profile image
Omar

A lot of people like to call UnityScript by the name "JavaScript." I believe this is wrong on several levels.

While "JavaScript" could refer to any one of the ECMAScript specs, Unity's ".js" language doesn't even come close to conforming to that specification — nor does it try to. UnityScript is a proprietary language, and it doesn't follow any concrete specification; it is modified at the will of the Unity developers.
The vast majority of JavaScript libraries you find will not work just by copying them into Unity. Unity's "JavaScript" is most similar to Microsoft's JScript.NET, although it is not quite identical.

  • JS is class-free, UnityScript have them, and that once defined are fixed for the duration of the runtime.
  • File name matters in UnityScript, where most files represent a single class.
  • UnityScript supports .NET OOP features like classes,"protection levels" (public, private, protected) and "static" keyword options. Since it also supports explicit typing, it also has support for "generics" (runtime type enforcement), which JavaScript has no notion of.
  • And unlike the popularity of Javascript, UnityScript should be buried deep and nobody should be allowed to use it, at all.
Collapse
 
michaeljota profile image
Michael De Abreu

Actually UnityScript, Unity flavor of Javascript that have types, is deprecated, and will be removed this year from the Engine. Unfortunately.

Collapse
 
ky1e_s profile image
Kyle Stephens

:(

Collapse
 
jochemstoel profile image
Jochem Stoel

K, are you creating a game yourself or are you involved somehow in something game related? Your profile says 'mobile consultant', a mobile game perhaps?

Collapse
 
kayis profile image
K

I created a few small games as a hobby (Web based). Didn't try myself on "professional" game development tho :D

Collapse
 
jochemstoel profile image
Jochem Stoel

Do you want to? Hobby or professional either way.

Thread Thread
 
kayis profile image
K

Yes, it's more a quesion of time than want haha

Thread Thread
 
jochemstoel profile image
Jochem Stoel

Yes you want to but you do not have time for a game related project?

Thread Thread
 
kayis profile image
K

yes, pretty much that

Collapse
 
vovchisko profile image
Vladimir Ishenko

Really funny example of MMO based on VueJS, HTML/CSS and NodeJS - twitter.com/vovchisko/status/11052...

Collapse
 
cleysonlb profile image
Cleyson Leal Braga

I like PhaserJS, it's simple and funny to make games!

Collapse
 
abandonedfridge profile image
Daniel Nielson

Oooh! Babylon looks fun! Currently have a few Phaser projects going though... maybe I should finish up one or two of tho... ooh look! A 3D rendering of a deserted house! 3demo.giroptic.io/

Collapse
 
kayis profile image
K

:D

started 10
finished -2

Collapse
 
mmarinez20 profile image
Manuel Mariñez • Edited

I would like to mention Godot Engine it also make use of JavaScript for HTML5 exports. Leaning curve is decent and they recently release 3.0