Sign in to follow this  
FractalSequence

New to Phaser and Visual Studio question

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:

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

I really think there is no reason not to use typescript.

I haven't tried typescript yet but one thing does concern me.

Will it be difficult to add external JS API (say, compulsory API from game sponsors) later on, if we're not using JS?

Share this post


Link to post
Share on other sites

 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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.