flokomike Posted April 10, 2017 Report Share Posted April 10, 2017 Being rather new to Phaser I have run into a problem that have halted my progressed. The code in question is as following. //Gun this.weapon = game.add.weapon (20, 'missile'); this.weapon.bulletKillType = Phaser.Weapon.KILL_WORLD_BOUNDS; this.weapon.bulletAngleOffset = 0; this.weapon.fireAngle = 0; this.weapon.bulletSpeed = 400; this.weapon.fireRate = 100; this.weapon.trackSprite(sprite, 90,52) And it gives me the following error TypeError: Phaser.Weapon is undefined In my test project I have the exact same piece of code, the only difference is that my current project uses game states and the previous is contain in a single .js file Anyone had a similar error and/or have a solution? I have added the project as a .rar file in case that helps Heli-cop hero opgave_2.rar Quote Link to comment Share on other sites More sharing options...
jjwallace Posted April 11, 2017 Report Share Posted April 11, 2017 var weapon? Quote Link to comment Share on other sites More sharing options...
samme Posted April 12, 2017 Report Share Posted April 12, 2017 On 4/10/2017 at 4:29 AM, flokomike said: TypeError: Phaser.Weapon is undefined Make sure you're using a newish Phaser (2.6, 2.7). Quote Link to comment Share on other sites More sharing options...
flokomike Posted April 12, 2017 Author Report Share Posted April 12, 2017 Ok updating my Phaser seemed to solve the issue (silly me) Thanks for the 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.