FakeWizard

Members
  • Content count

    52
  • Joined

  • Last visited

About FakeWizard

  • Rank
    Advanced Member
  • Birthday 04/07/1985

Profile Information

  • Gender
    Male
  • Location
    Slovakia
  1. have you tried defining this.input.maxPointers = 1; in your game boot state?
  2. same here, unable to switch to fullscreen on my Huawei Honor 8, Android version 7.0, Chrome v.57.0.2987.132.
  3. the js file where you have the function B defined has to be loaded before the other file where you;re using it. /// fileA.js function A (){ game.add.sprite = sprite1(some.x, some.y) B(); } /// fileB.js function B (){ game.add.sprite= sprite2(sprite1.x, sprite1.y); } So in your index.html file you just do <script src="fileB.js"> </script> <srcipt src="fileA.js"> </script>
  4. it's very easy to cheat in this game..you put too much trust on client-side ;] .. Sorry for trolling the players (or AI ).. was able to shoot like 100 bullets at once :] But apart from that it's really nice game, works pretty well :]
  5. It's because you're passing the methods in an object, in such cases these methods will always refer to it's parent object. Which in this case is Phaser.Game. And this.MyColor variable doesn't exist there. let preload = function(){ console.log( this ) //// points to Phaser.Game } var game = new Phaser.Game(1200, 600, Phaser.AUTO, 'content', { preload: preload }) I'd recommend using ES6 way of extending Phaser classes , it's less confusing IMHO. class BootState extends Phaser.State { init(){ this.myColor = Phaser.Color.createColor(255,255,0); } preload(){ this.game.load.image("platform", "star.png"); } create() { console.log(this.myColor); } } class SimpleGame extends Phaser.Game { constructor() { super(1200, 600, Phaser.AUTO, 'content' ); } init(){ this.state.add("boot", BootState ); this.state.start('boot'); } } window.onload = () => { var game = new SimpleGame().init(); };
  6. I know that there is a separate method Sprite.resetFrame() which resets the texture's frame to default. But I just though it may be easier if it was all done implicitly while calling the Sprite.reset() method. So I'd just add another optional parameter to the reset method, and then based on this parameter call or not call the resetFrame method. reset( x: number, y: number, health?: number, resetFrame: boolean ): Phaser.Sprite;
  7. the code seems ok, can you see any errors in your browser's console? Are you testing this purely in your browser or from a http server?
  8. you have to define the functions (create, update, reload ..) inside thier appropriate js file and load them before the game.js... No need to define the functions in game.js otherwise you'll overwritte them.
  9. It's pure guess, but I think, it could be cause you're adding an existing instance of object which is currently being initialized. Perhaps changing the order a little bit may help here. class Player extends Phaser.Sprite { constructor(game, x, y) { super(game); this.playerBody = this.addChild( game.add.sprite( x, y, 'atlas1', 'dot' ) ); this.playerBody.anchor.set(0.5); this.inputEnabled = true; this.input.enableDrag(); this.enableBody = true; this.game.physics.enable(this, Phaser.Physics.ARCADE); game.world.add( this ); } } Also not really sure what are you trying to do here.. is the little box your hit box? Also are you sure you want to position this box on the same position as Player? Cause now Player will be placed at 0,0 position and the 'dot' will be spawned at the x,y (pre-defined) coordinates.
  10. I don't see anything dancing there, can you be more specific? Although I've simplified your animation loop by a little bit. https://jsfiddle.net/7dv61c63/3/
  11. pixi.js

    not sure why but the snake blips every time I press a cursor key. Apart form that game looks good
  12. With regards to handling events, Phaser its-self is also using Phaser.Signal to trigger specific kind of events. So from my point of view, it's definitely doable in either React or Phaser. With Phaser however, you application may feel morel like a real game, where in the other case it may fell like a simple web-page with animated text.
  13. oh my bad, the upper message is just a warning :] .. To identify what's causing the actual error we need to see more code, not just error message!
  14. AFAIK Chorme has dropped support for webkitAudioContext in their latest release. So instead of that you can now use AudioContext. For more information read the changelog here.
  15. as mentioned here, you don;t need to re-add the background sprite to the scene / world. You only need to change the background texture. If the background variable is globally accessible then you can just call background.loadTexture( "newTIleSpriteName" )