prof.kerfuffle

Members
  • Content Count

    5
  • Joined

  • Last visited

About prof.kerfuffle

  • Rank
    Newbie

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks for trying it out! I'm using Visual Studio Community 2015, with typescript 1.8.35.0. Could this be some typescript definition import issue? I've merely placed the .d.ts files inside the root folder, and at least in VS it automatically imports them, so I haven't done any explicit importing inside the script files. I did however notice that changing: this.game.add.plugin (Fabrique.Plugins.InputField); to: this.game.plugins.add (Fabrique.Plugins.InputField); gets rid of the first error but I'm not sure whether it does the same thing (I've seen both used in examples when adding plugins). But the line adding the inputField (this.game.add.inputField (10, 90);) still yields the same error as before: Here are the files, in case I've done some silly mistake. module Game { export class Plugin_test { game: Phaser.Game; constructor () { this.game = new Phaser.Game (1280, 720, Phaser.AUTO, 'content', {create: this.create}); } create () { this.game.plugins.add (Fabrique.Plugins.InputField); //this.game.add.plugin (Fabrique.Plugins.InputField); var input = this.game.add.inputField (10, 90); // produces error: "Property 'inputField' does not exist on type 'GameObjectFactory'". } } } window.onload = () => { var game = new Game.Plugin_test (); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>plugin_test</title> <link rel="stylesheet" href="app.css" type="text/css" /> <script src="app.js"></script> <script src="phaser.js"></script> <script src="phaser-input.js"></script> </head> <body> </body> </html>
  2. Thanks for the reply! I've only tried two third-party ones, both with typescript definitions. For instance phaser-input (https://github.com/orange-games/phaser-input). In non-typescript javascript it works as planned: game.add.plugin(Fabrique.Plugins.InputField); var input = game.add.inputField(10, 90); In typescript I get the following errors (with typescript definitions present): I'm guessing this is because the plugin isn't part of the Phaser.Game object, and can't be added dynamically like in javascript. I feel like I may be missing something very basic here, so for newbies such as myself it would be very helpful with some kind of (official) information on the topic, perhaps as part of the Typescript Introduction tutorial, since it's really felt like hitting a wall on this issue, with otherwise excellent documentation/introductory material available.
  3. So I'm a phaser/html5 newbie, but coming from java I've chosen to take the typescript route, and am now trying to get plugins to work, but have been having major issues, and haven't been able to find any "official" information about typescript plugin support, only a few threads here with hacky solutions that haven't worked for me. What confuses me is that there are often typescript typings along with the plugins, which would indicate that they're supposed to work with typescript. Any insight into this would be greatly appreciated, and if I may suggest, should perhaps be more clearly presented in the documentation.
  4. Thanks for your tip! I should have mentioned that I'd prefer some kind of permanent storage solution, so a level can be designed over longer periods of time, and not be computer dependent, since I switch between computers a lot. But it's nice to have it as an option!
  5. I come from java land, and am making a game which includes a level editor, so the data needs to be stored somewhere (json files), and I am curious about my options. The level editor is for my use, so I could have a separate version of the game for creating the data, using something like node.js or similar, but ideally there would only be one version. So, any ideas would be very welcome, the easier to implement for a phaser/html5 noob the better Edit: Forgot to mention that I'd prefer a permanent storage solution that ideally isn't reliant on a particular computer, since the levels will be developed over longer periods, and on multiple devices. But any ideas are welcome!