wog Posted December 11, 2014 Report Share Posted December 11, 2014 I want to make polygon but have problem Uncaught TypeError: Cannot read property '0' of undefined this.points = this.groundGenerator(); this.poly = new Phaser.Polygon(this.points);this.graphics = this.game.add.graphics(0, 0); this.graphics.beginFill(0xFF33ff);this.graphics.drawPolygon(this.poly.points); this.graphics.endFill(); groundGenerator: function (){ var points = []; for(var x=this.getRandomInt(50, 150); x<1024; x+=this.getRandomInt(10, 100)) { points.push(new Phaser.Point(x, this.getRandomInt(0, -150) + 10)); } return points; } Thanks Quote Link to comment Share on other sites More sharing options...
wog Posted December 11, 2014 Author Report Share Posted December 11, 2014 That solved. Just updated Phaser from 2.0.1 to 2.2.1 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.