wexing Posted November 23, 2016 Share Posted November 23, 2016 Hello i'm new in phaser. There is this rope example on website https://phaser.io/examples/v2/sprites/rope. Can anyone explain how to make same effect just move it from left to right (for example trees in a wind image). Link to comment Share on other sites More sharing options...
LuizOtavio Posted November 23, 2016 Share Posted November 23, 2016 hi @wexing, i dont know if i understood your point, but, in rope example, to change their animation up down to left right, change line 31 'y' to 'x' this.points[i].x = Math.sin(i * 0.5 + count) * 20; is that your point? cheers Link to comment Share on other sites More sharing options...
wexing Posted November 24, 2016 Author Share Posted November 24, 2016 Amm don't know how to explain right.. Its okay with chaning to x.I tryied it before this post, but that makes animation move not exactly what i want. When i change it to x she move left to to right but deformating my image. You can check it there https://phaser.io/sandbox/edit/dsaxRcPd . Btw movment should be like trees in this gif (didn't find a better example) Link to comment Share on other sites More sharing options...
LuizOtavio Posted November 24, 2016 Share Posted November 24, 2016 oh, yeah, ofcourse will deformate. you need to 'rotate' the image. In the sandbox that you send, change line 13 on create to points.push(new Phaser.Point(0, i * length)); cheers Link to comment Share on other sites More sharing options...
Recommended Posts