VicFirth

Members
  • Content Count

    3
  • Joined

  • Last visited

  1. VicFirth

    Animation on follower object?

    Is there an example in the Phaser documentation? I've searched far and wide but couldn't find a proper example.
  2. VicFirth

    Animation on follower object?

    Hi, I was wondering if you can add an animation to a follower object? I want to spawn enemies that have their own walking animations and walk their own path (using startFollow()) Thanks.
  3. Hi Everyone, I want to rotate my bounding box of my follower object that I've created. Is this even possible? If so, how to do it? This is a little snippet of my code: class Car { constructor(game, texture, path){ var curve = new Phaser.Curves.Path(game.cache.json.get(path)); var graphics = game.add.graphics(); graphics.lineStyle(1, 0xff0000, 1); curve.draw(graphics, 128); graphics.fillStyle(0x00ff00, 0.5); this.game = game; this.car = this.game.add.follower(curve, 0, 0, texture); //Set the size of the bounding box this.car.setSize(0,35, true); this.game.physics.world.enableBody(this.car); this.car.rotate = 45 //????? this.path = path; //Start following along the predefined path this.car.startFollow({ duration: 7000, positionOnPath: true, rotateToPath: true, verticalAdjust: true }); } So what I want is this: but what I get is this: How can I achieve that with a follower? Thanks.