• Content Count

  • Joined

  • Last visited

  • Days Won


samme last won the day on September 1

samme had the most liked content!

About samme

  • Rank
    Advanced Member

Contact Methods

  • Website URL

Recent Profile Visitors

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

  1. samme

    problem with using phaser with classes

    You need to start the Main scene from the Boot scene. See (follow the this.scene calls). After creating the game, you shouldn't instantiate scenes yourself. Phaser will do that. See the links in for more background.
  2. samme

    multiatlas animation

    Actually, just do, in create(): console.log(this.anims.generateFrameNames('man')); That should show you all the names. If your animation uses every frame, you can just use that: this.anims.generateFrameNames('man') Otherwise, you need something like this.anims.generateFrameNames('man', { start: 0, end: 1, // or however many prefix: 's4b2manw_', suffix: '.png', zeroPad: 4 });
  3. samme

    Problem extending the Group class and ARCADE

    Take myBackground out of all the groups and create/enable it by itself. I can't remember how Graphics+Physics objects work, you may have to draw on it before enabling the physics body, or you may have to use body.setSize().
  4. samme

    multiatlas animation

  5. samme

    How do I restart scene?

    Move buttonGameRestart.addEventListener() into the scene constructor.
  6. samme

    Problem extending the Group class and ARCADE

    enableBody means any new children added to the group are given a physics body. If the group has no children, nothing important will happen. I'd guess you need something like game.physics.enable(this.myBackground);
  7. samme

    Phaser Destroy GameObjects

    I don't know. It looks like destroy() removes its game object from the update list immediately, so I don't see how preUpdate would get called after that. Nonetheless, you can probably test in preUpdate to avoid the error.
  8. samme

    Clicks on Object and Background
  9. samme

    Strange rewriting of a variable at Tilemap.js

    getLayer just converts a layer identifier into the actual layer contents. If you read the method like this it makes a little more sense: var layerData = this.getLayer(layer); if (layerData === null) { return null; } return TilemapComponents.HasTileAt(tileX, tileY, layerData);
  10. That sounds similar to phaser-ce/issues/273.
  11. samme

    Get container by name

    Well, it doesn't track them, but it can search them. Phaser.Actions.GetFirst(containers, { name: 'Container1' });
  12. samme

    How do I restart scene?

    Where is buttonGameRestart.addEventListener(…)? Is it inside a scene method?
  13. samme

    Phaser 3 setTextBounds equivalent

    You may not need a boundary for centering: this.add.text(300, 525, "text", style).setOrigin(0.5, 0.5); or Phaser.Display.Align.In.Center(text,, y, width, height));
  14. samme

    Sprite gets separate from body

    You can try // After reset(…) game.stage.updateTransform();; I'm not sure all of those are necessary.
  15. samme

    How do I restart scene?

    Make sure you add the event listener only once, ever. And use the latest stable Phaser.