Jack0815 Posted October 28, 2014 Share Posted October 28, 2014 Hi Folks,I am developing a free game with the phaser framework. On my startScreen I want to have some kind of Army-Tags that are pinned to my background. To make it more fun I would like to have them swing with moving my phone.I have no Problems getting the phone angle, neither making it swing with yoyo-tweens ... but ... when I want to adjust the angle of the sprite in the update phase (according to the phone-angle), this interfers with the swinging tween. Does anyone have a easy solution? Interrrupting the tween and changing the rotation doesn´t work. Or is there a way to place a changing variable in the tweens porperty?I also played around with p2 a bit, but just for some gimming I don´t want to include p2 into the game.Would be nice to find a solution. Although it is just a gimming, I would really like to have it in the game.GreetzJack PS: added a screenshot of the homescreen to clarify my needs Link to comment Share on other sites More sharing options...
lewster32 Posted October 28, 2014 Share Posted October 28, 2014 You could use groups to accomplish this - you could put each tag in a group, then apply the swinging tween to the tag, and the angle of the phone to the group. That way the tag can continue swinging freely while the group sets the overall angle of the swing. Jack0815 1 Link to comment Share on other sites More sharing options...
lewster32 Posted October 28, 2014 Share Posted October 28, 2014 Here's an example: http://jsfiddle.net/lewster32/j5rqycgq/ Jack0815 1 Link to comment Share on other sites More sharing options...
Jack0815 Posted October 28, 2014 Author Share Posted October 28, 2014 Thanks a lot for the fast reply.Tried it, worked, solved ;-)Awesome EDIT:Unfortunately, not as smooth as exspected on the phone. lewster32 1 Link to comment Share on other sites More sharing options...
Recommended Posts