Welisa Lewis Posted January 23, 2018 Share Posted January 23, 2018 i need help with a game i'm creating. I need a platform which has a curved path and the player moves along the path created. I have created a path using Bezier Interpolation which creates a path using random points in a range. The issue is that i can only create the outline of the path and i need to fill the area under the curve so that it looks like a solid platform. Link to comment Share on other sites More sharing options...
bubamara Posted January 23, 2018 Share Posted January 23, 2018 divide the path segment between two control points of bezier curve, take these points and use them to construct mesh Link to comment Share on other sites More sharing options...
Welisa Lewis Posted January 24, 2018 Author Share Posted January 24, 2018 Thank you so much for this!! Link to comment Share on other sites More sharing options...
Welisa Lewis Posted January 24, 2018 Author Share Posted January 24, 2018 However, could you please help me with how to fill the entire area under the curve with a colour so that it looks solid. I am using a catmullRom interpolation this is the code below: my array of this.points is: this.points = { 'x': [ 0, 128, 256, 384, 512, 608, 800, 1050, 1230, 1600, 1800 ,2000 , 2500 ], 'y': [ 410, 350,500, 440, 360, 540 ,370 ,425, 400, 540, 470, 460, 415] }; Link to comment Share on other sites More sharing options...
bubamara Posted January 24, 2018 Share Posted January 24, 2018 ouch Phaser... I was talking about pure PIXI way - http://pixijs.download/release/docs/PIXI.mesh.Mesh.html you should ask in Phaser section instead Link to comment Share on other sites More sharing options...
ivan.popelyshev Posted January 24, 2018 Share Posted January 24, 2018 Moving to phaser. Link to comment Share on other sites More sharing options...
samid737 Posted January 24, 2018 Share Posted January 24, 2018 You draw rectangular strokes like this picture below: You can specify where you want each rectangle to start, the arguments for this.bmd.rect() is x,y, width, height. Example: Link to comment Share on other sites More sharing options...
Welisa Lewis Posted January 28, 2018 Author Share Posted January 28, 2018 Thank you so much!! This helped a lot. Link to comment Share on other sites More sharing options...
Recommended Posts