Jump to content

Uncaught TypeError: d.setTo is not a function


TheCodeCrafter
 Share

Recommended Posts

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!

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...