rich

Would any of you care if I dropped TypeScript support from Phaser?

Recommended Posts

hi, 

I noticed this thread and I am asking myself if the phaser.d.ts is still maintained? There are some plain inconsistent declaration there even the game constructor is wrong.

I myself want to use Typescript, and i found about Phaser following some blogs that advertise it as the first library with typescript support.

Now that Webstorm supports typescript too, and more nicely than visual studio, I feel encouraged to give it a try.

 

Coulf you guys please post what exactly were the show stoppers?

 

Regarding Javascript i got a tweet today that sums what i think of Js:

 

Rodney Rehm @rodneyrehm

If it quacks like a duck, but looks like a cat with a horse head, it must be JavaScript.

 

Regards

Share this post


Link to post
Share on other sites

Typescript doesn't make Javascript any better, it just makes the experience of programming javascript marginally better. It seems Typescript support is outdated and no longer maintained. I personally have no problem with that. If I wanted to program with an elegant statically typed language I would be using Haxe, but I want to make an HTML5 game, so I use Javascript (I know you can make an HTML5 game with Haxe + Flambe, but I wanted to check out Phaser for research purposes).

 

It's really not that bad. Programming is programming, regardless of what language you use. I share Rich's sentiment... don't focus on what features a language does or doesn't support, focus instead on how you can use the features that the language provides in order to accomplish your goal of making a game.

Share this post


Link to post
Share on other sites

Once Rich told that TypeScript is cool enough for making the games but the Phaser core will stay vanilla JS.

 

So with TypeScript hitting 1.0.0 and compile problems are cleaned also Phasertype definitions are up to date then... 

 

It all sound like a god reason to set your code base with TS.

Share this post


Link to post
Share on other sites

Hi...

 

bit late to the party but wondering what the current status of this is?

 

I'm an AS3 developer originally and I just started looking at Phaser and TypeScript, using Visual Studio Code (or Webstorm) as an IDE.... and I'm loving the intellisense/autocompletion you can get. Similar to what I had with FlashDevelop

 

I know most people aren't using it but is someone keeping the phaser.d.ts up to date?

 

thanks

J

 

fba52.jpg

 

mhpo94.jpg

Share this post


Link to post
Share on other sites

Yeah there are a good few of us using it (d.ts definition file).  The community make PRs (but less frequently which I take as a good thing), Rich adds definitions where he can, and I often review changes a couple of times a month to mop up any stranglers. 

It does not have Box2D or Creature definitions yet. P2 may be slightly outdated... Aside from these features though, I would say its probably conservatively around 97% accurate!

Welcome btw, I am from the same planet as you and use TS for the same reason! :D

Share this post


Link to post
Share on other sites

The Phaser defs are very accurate. Phaser may not be written in TypeScript any longer, but the defs are maintained.

 

Also for what it's worth some of the biggest (in terms of codebase size) Phaser games out there are developed in TypeScript (the Doctor Who Game Maker being a good example).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.