samme

Members
  • Content Count

    2160
  • Joined

  • Last visited

  • Days Won

    24

Posts posted by samme


  1. You have to avoid the Phaser 2 examples, they won't work and will confuse you. https://medium.com/@michaelwesthadley/modular-game-worlds-in-phaser-3-tilemaps-1-958fc7e6bbd6 etc. will be better help.

    var monsters = this.physics.add.group();
    
    monsters.addMultiple(map.createFromObjects(
      'Monsters',
      'blob',
      { key: 'monster' },
    ));
    
    monsters.getChildren().forEach(function (enemy) {
      // You need to use the `body` methods because these are Sprites (not ArcadeSprites)
      enemy.body.setBounceX(1);
      enemy.body.setCollideWorldBounds(true);
      enemy.body.velocity.x = 40;
    }, this);