CinkoNaap Posted January 8, 2014 Share Posted January 8, 2014 Hey guys, I am just starting with Phaser, and I have a problem at the very beginning.I created HTML with TypeScript project in Visual Studio 2013, and created the simplest project structure:* phaser.js and phaser.d.ts ( from dev branch )* Application.ts ( simple game init )* default.htm, with : <script src="phaser.js"></script> <script src="Application.js"></script>And I cannot run this project, because there is an error "Could not find symbol Phaser".I think everything is set up ok. Maybe you can lead me to my mistake? Link to comment Share on other sites More sharing options...
Tarion Posted January 8, 2014 Share Posted January 8, 2014 Can you post the code of your Application.ts? And mark the line with the error? Maybe you just need to refference the d.ts by adding the following to to top of your Application.ts///<reference path="phaser/phaser.d.ts"/> Link to comment Share on other sites More sharing options...
CinkoNaap Posted January 8, 2014 Author Share Posted January 8, 2014 default.htm<script src="phaser.js"></script><script src="Application.js"></script>Application.tsclass SimpleGame { constructor() { this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', { preload: this.preload, create: this.create }); } game: Phaser.Game; preload() { } create() { }}window.onload = () => { var game = new SimpleGame();};I didn't want to create anything fancy, just get the first error-free compile and run.The problem is with refferencing to Phaser "class", like there's no source/lib path. Link to comment Share on other sites More sharing options...
CinkoNaap Posted January 8, 2014 Author Share Posted January 8, 2014 I just wonder is there any way to use "import" syntax rather than ///<ref ? Link to comment Share on other sites More sharing options...
Recommended Posts