• Content Count

  • Joined

  • Last visited

About FabianJarrett

  • Rank

Recent Profile Visitors

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

  1. I can only get input by clicking the <body>, not the <canvas>.
  2. I made a post saying that the keyboard was scrolling the webpage but I've noticed that the key input does not work when I click off the game. If I click somewhere else in the browser and click back on the game the game won't recognise key input. Any idea why it would do that? I've seen it was a bug but it's fixed.
  3. I'm using this to stop keys controlling the scrolling of the browser but it's not working: this.game.input.keyboard.addKeyCapture([ Phaser.Keyboard.UP, Phaser.Keyboard.DOWN, Phaser.Keyboard.LEFT, Phaser.Keyboard.RIGHT, Phaser.Keyboard.SPACEBAR, ]); I'm using this input like this if it makes a difference: if (this.game.input.keyboard.isDown(Phaser.Keyboard.UP)) { direction = Swipe.UP; } else if (this.game.input.keyboard.isDown(Phaser.Keyboard.DOWN)) { direction = Swipe.DOWN; } else if (this.game.input.keyboard.isDown(Phaser.Keyboard.LEFT)) { direction = Swipe.LEFT; } else if (this.game.input.keyboard.isDown(Phaser.Keyboard.RIGHT)) { direction = Swipe.RIGHT; } What am I doing wrong?
  4. I have a lot of sprites for the background in a phaser grohp and they don't move. I'm thinking it would be a lot more efficient on mobile devices to have them all turned into one big image at runtime as their position won't change or anything. How would I go about doing this?
  5. I'm making my levels with Tiled and my tiles are 32x32. I would like to use different size tiles in my game depending on the screen size but I can't get 64x64 tiles to line up. Is there a way to change the map's tile size in Phaser?
  6. I need to educate myself more. I thought you could just compile C++/C# to any console. And I thought C# would run faster. Cheers for the info.
  7. Would the performance not be better with native c# though? And it could potential be compiled to other platforms.
  8. I know this isn't to do with html5 development but I'm not sure where to start this topic. Has anyone tried to port Phaser to C# so they can make desktop games? I saw a post about Retyped but that looks like it's designed to compile back to javascript. It would be interesting to see if there is a port already as I'm not having much luck with MonoGame on Linux and I'm so comftable with Phaser. Are there any reasons why it would not be a good idea. Obviously it would need to use different libraries.
  9. Cheers that works. The value would never reach 1.0 so I fired it off after 0.9.
  10. <body style="margin: 0px"> This was the fix!
  11. The canvas doesn't fit tight in the body. Is there a way to remove the margin? this.game.scale.scaleMode = Phaser.ScaleManager.SHOW_ALL; this.game.scale.parentIsWindow = true; Not sure if these setting make a difference.
  12. Thanks. I can't find this.game.world.getLast(). Is that a custom function I should make up?
  13. This is how I'm getting an object (Ball) from a tile map and finding a reference of it: // Game's create map.createFromObjects("objects", 3, "ball", 0, true, false, undefined, Ball); this.game.world.forEach(element => { if(element instanceof Ball) { this.ball = element; } }); // Ball's contructor this.game.add.existing(this); I've saw the examples and they are getting objects from adding them to a group. I only have one Ball and that will be the player so I thought putting it in a group was a bad idea? This way I have a class that directly controls the Ball. Is there a better way than doing this?
  14. But can't NW.js compile to a desktop app? Nintendo doesn't need to support HTML5 if the game is doing it itself.
  15. Would Phaser ever be able to run on a Nintendo Switch as a native game, not a browser game?