makis Posted September 10, 2018 Share Posted September 10, 2018 var config = { type: Phaser.AUTO, width: 800, height: 600, scene: { preload: preload, create: create } } var game = new Phaser.Game(config); function preload() { this.load.image('rocket','rocket.png') } function create() { //var rocket = this.add.sprite(100, 400, 'rocket'); //rocket.setRotation(-0.2); var path1 = new Phaser.Curves.Path(100, 400).splineTo([200,250,400,280]) var graphics = this.add.graphics(); graphics.lineStyle(1, 0xffffff, 1); //what is 1, , 1 path1.draw(graphics, 328); //what is 328 rocket = this.add.follower(path1, 0, 0, 'rocket'); // what is 0, 0 rocket.startFollow({ positionOnPath: true, duration: 1000, repeat: -1, rotateToPath: true, verticalAdjust: true }); } // how to make the rocket points to the path? How to make rocket point to path? What is ... see the comments in code snippet? FROM PHASER 3 EXAMPLES Link to comment Share on other sites More sharing options...
Recommended Posts