TheCodeCrafter Posted February 7, 2017 Share Posted February 7, 2017 Alright. I'll cut to the chase. I'm making a simple game about abducting people, and I want the victims to run from the player or "flying saucer". This is what I have setup in the update function (I'm pretty sure the rest is irrelevant, but tell me if you need more): this.win.angle = game.physics.arcade.angleToXY(this.win, -(this.player.x), -(this.player.y)); this.win.velocity = game.physics.arcade.velocityFromAngle(this.win.angle, 145, this.win.body.velocity); game.world.wrap(this.win, 0, false); Now here is the error after getting to the "play" state (Oh and by the way, the game is based off of the state tutorial for phaser, except with a lot of edits and a lose.js file.): Uncaught TypeError: d.setTo is not a function at c.Physics.Arcade.velocityFromAngle (phaser.min.js:23) at Object.update (play.js:94) at c.StateManager.update (phaser.min.js:10) at c.Game.updateLogic (phaser.min.js:12) at c.Game.update (phaser.min.js:12) at c.RequestAnimationFrame.updateRAF (phaser.min.js:18) at window.requestAnimationFrame.forceSetTimeOut._onLoop (phaser.min.js:18) Please help! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.