• Content Count

  • Joined

  • Last visited

  1. nickbyfleet

    Game list of phaser games

    We just did this at Heyday and JWT New Zealand using Phaser to promote youth enrolment in our upcoming elections. Battle to the Beehive
  2. nickbyfleet

    Virtual joystick plugin for Phaser and Typescript

    I've been banging my head against the wall all day trying to get the virtual joystick plugin to play nice with a Phaser/Typescript project... after 3 or 4 disastrous approaches, I've finally got it working. It's not ideal, but solution is to host the plugin externally and then use the game.load.script() approach while casting the Phaser.VirtualJoystick object as any: // In preload() if (! || this.forceMobile) { // Preload the joystickPlugin plugin'joystick', ''); this.load.atlas(Assets.Atlases.ArcadeJoystick.getName(), Assets.Atlases.ArcadeJoystick.getPNG(), Assets.Atlases.ArcadeJoystick.getJSONArray()); } // In create() if (! || this.forceMobile) { // Load the joystick and buttons this.joystickPlugin = as any); this._stick = this.joystickPlugin.addStick(0, 0, 200, Assets.Atlases.ArcadeJoystick.getName()); this._stick.alignBottomLeft(100); this.buttonP = this.joystickPlugin.addButton( - 330, - 150, Assets.Atlases.ArcadeJoystick.getName(), 'button2-up', 'button2-down'); this.buttonS = this.joystickPlugin.addButton( - 215, - 220, Assets.Atlases.ArcadeJoystick.getName(), 'button1-up', 'button1-down'); this.buttonK = this.joystickPlugin.addButton( - 100, - 150, Assets.Atlases.ArcadeJoystick.getName(), 'button3-down', 'button3-up'); } I signed up to post this snippet in the hope this saves someone else a headache.