PROGRAM_IX Posted April 27, 2013 Share Posted April 27, 2013 I'm clearly missing something. I pulled down from GitHub (just now, again, to make sure) and am running almost verbatim the rect vs. rect test from the test suite. Or rather, I'm trying. I installed Node.js and used npm to get the tsc compiler, which seemed fine. But then I tried to actually compile something and I got screenful after screenful of errors. .../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(140,21): The property 'scrollFactor' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(140,52): The property 'scrollFactor' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(142,55): The property 'scrollFactor' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(143,55): The property 'scrollFactor' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(147,21): The property 'angle' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(149,21): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(150,21): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(152,25): The property 'angle' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(154,25): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(154,57): The property 'angle' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(162,22): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(175,48): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(179,48): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(185,21): The property '_game' does not exist on value of type 'ScrollZone'.../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/phaser/Phaser/gameobjects/ScrollZone.ts(16,4): Base type 'any' lacks an implementation..../programming/html5/phaser/ld48/test.ts(5,28): The property 'Game' does not exist on value of type 'Phaser'.../programming/html5/phaser/ld48/test.ts(15,13): The property 'velocity' does not exist on value of type 'Phaser.GeomSprite' (That's the last few lines, but it seems to have a problem with just about every Phaser class.) It just goes on like that. Here's my directory structure: .../programming/html5/phaser: phaser/ [Phaser library] Phaser/ Docs/ ld48/ [site of game code if it ever works] test.ts [rect vs. rect from test suite, with one change (see below)] The only change I've made to the test.ts file is this: /// <reference path="../phaser/Phaser/Game.ts" /> And here's how I compile: tsc test.ts That should work, right? It's clearly *finding* the Phaser files, but what is the deal with these errors? Any help greatly appreciated. Falling at the first hurdle is never fun. Link to comment Share on other sites More sharing options...
Hsaka Posted April 27, 2013 Share Posted April 27, 2013 Hi, please try compiling your test.ts file with the following command: tsc test.ts --target ES5 PROGRAM_IX 1 Link to comment Share on other sites More sharing options...
PROGRAM_IX Posted April 27, 2013 Author Share Posted April 27, 2013 Thanks, I will! I was looking at those options earlier, but seeing the default is ES3 I thought that ES5 would only *increase* the possibility for errors.---Oh wow, that was dramatic. The errors have now been reduced to this: .../programming/html5/phaser/phaser/Phaser/system/Device.ts(384,49): The property '$1' does not exist on value of type '{ (pattern: string,flags?: string): RegExp; new(pattern: string,flags?: string): RegExp; }' Link to comment Share on other sites More sharing options...
Hsaka Posted April 27, 2013 Share Posted April 27, 2013 Not sure what's going on there but it seems to be related to this: http://typescript.codeplex.com/workitem/695Maybe you could try commenting out or replacing that line and recompiling just to get you up and running. PROGRAM_IX 1 Link to comment Share on other sites More sharing options...
PROGRAM_IX Posted April 27, 2013 Author Share Posted April 27, 2013 Silly me, I should have Googled the new error. Using --nolib as that link suggests does not work, but commenting out the line (which was something to do with Internet Explorer detection) did. Now I can run games at last! Thank you very much for your help. Link to comment Share on other sites More sharing options...
rich Posted April 28, 2013 Share Posted April 28, 2013 Phew.. I saw your tweet about this earlier while at the park with my kids but didn't have time to look at it until now, so thank you very much Hsaka Yeah it needs ES5 and nolib as you've found out! Let me add that to the readme file now Link to comment Share on other sites More sharing options...
PROGRAM_IX Posted May 2, 2013 Author Share Posted May 2, 2013 Phew.. I saw your tweet about this earlier while at the park with my kids but didn't have time to look at it until now, so thank you very much Hsaka Yeah it needs ES5 and nolib as you've found out! Let me add that to the readme file now Don't worry about it, I wouldn't have tweeted you at all but I had tried a couple of things with no success and wasn't sure just how silly a mistake I was making. --nolib didn't actually fix it, though! The ES5 reduced it to one error, but --nolib freaked it out all over again. I did have to go into the code of Device.ts and comment out a line. So --nolib wasn't the solution in my case, anyway. I probably just did that wrong too. XD Link to comment Share on other sites More sharing options...
Recommended Posts