FractalSequence Posted January 22, 2015 Share Posted January 22, 2015 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 Link to comment Share on other sites More sharing options...
stupot Posted January 23, 2015 Share Posted January 23, 2015 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 More sharing options...
Massemassimo Posted January 23, 2015 Share Posted January 23, 2015 I really think there is no reason not to use typescript. Link to comment Share on other sites More sharing options...
FractalSequence Posted January 23, 2015 Author Share Posted January 23, 2015 Thanks for the replies! Guess I'll just learn the API, can't be worse than Torque 2D... lol After a couple of games I'll probably switch to TypeScript anyway. Link to comment Share on other sites More sharing options...
uyerdna Posted February 7, 2015 Share Posted February 7, 2015 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? Link to comment Share on other sites More sharing options...
Tom Atom Posted February 7, 2015 Share Posted February 7, 2015 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 More sharing options...
Daniel Belohlavek Posted February 7, 2015 Share Posted February 7, 2015 I recommend TS too. I use it and I love it. Link to comment Share on other sites More sharing options...
Recommended Posts