Luka Posted November 20, 2018 Share Posted November 20, 2018 Hi everyone ! I am new to Phaser and i want make my own program for the first time. I start it but i can't understand one error "this.physics.arcade is undefined" After many looks at the doc, it's look like there is no sentance prob. var config = { type: Phaser.AUTO, width: 1366, height: 800, physics:{ default: "arcade", arcade: { debug: false } }, scene: { preload: preload, create: create, update: update, render: render } }; var game = new Phaser.Game(config); /************GLOBAL VAR**********/ var player; //player object player_spd = 150; function preload () { this.load.image("player", "assets/sprites/Player.png") } function create () { //player player = this.physics.add.sprite(1366/2, 800/2, "player"); //controls keys_var = this.input.keyboard.createCursorKeys(); } function update () { //oriente le vaisseau vers la souris player.rotation = this.physics.arcade.angleToPointer("player"); } function render() { this.debug.spriteInfo(player, 32,32); } </script> So i ask you help. ty! Link to comment Share on other sites More sharing options...
samme Posted November 20, 2018 Share Posted November 20, 2018 There's no this.physics.arcade object. Only this.physics. Unlike Phaser 2, there's no angleToPointer method, but you can calculate it: http://labs.phaser.io/edit.html?src=src\physics\arcade\velocity from angle.js Link to comment Share on other sites More sharing options...
Luka Posted November 20, 2018 Author Share Posted November 20, 2018 ty a lot! Link to comment Share on other sites More sharing options...
Recommended Posts