Jump to content

New to Phaser and Visual Studio question


FractalSequence
 Share

Recommended Posts

Hi,

 

I'm new to Phaser, in the past week I started my first game and l love everything about this framework. Just so you know I usually work with Unity and MonoGame.

 

Anyway I had a question regarding intellisense/code completion in Visual Studio 2013 for JS. I know about the /// <reference path="phaser.js" />, but my problem is more when I'm using the "this" identifier. I would like to know if there's a way to tell VS what "this" is Phaser.Game(...), just to help with the code completion of lets say this.load.image(show parameters).

 

Is this feature available in VS, should I get another IDE, should I switch to TypeScript or should I just suckit up and learn it all.

 

Thanks in advance  :lol:

Link to comment
Share on other sites

Hi, determination of 'this' at best can only really be guessed at.  Given the dynamic nature of JS, 'this' is only really exactly known at runtime.

 

Regarding VS intellisense, it gives you a few tricks to help with standard JS but there's only so much it can do.  Typescript will give you a bit more.

 

There are many other IDE's and typed languages that translate to JS to explore, I'm mostly familiar with VS.

 

You might find a way to improve things though, have a look at this:

 

    https://msdn.microsoft.com/en-us/library/hh524453.aspx

 

ps. I sucked it up

Link to comment
Share on other sites

  • 2 weeks later...

 I wrote first Phaser game with JS + Netbeans. For the second I choose VS 2013 + Typescript. I would never change back now...

 

Typescript is superset of JS and everything you write is translated into JS. So, there are no compatibility isseus from using Typescript. In other words: you are writing JS in more friendly way. Typescript definitions delivered with Phaser brings intelisense and autocompletion into IDE and really helps to increase productivity. Not speaking about type checking and thus preventing errors. VS 2013 Community is free for individual developers.

 

You can start with Typescript very simply - just paste your JS code into .ts file and it will get processed... you can rewrite your old code step by step or not rewrite it at all.

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...