jukoor Posted October 20, 2017 Share Posted October 20, 2017 HI all, im am struggling a little bit to create a animated sinwave in phaser. So what i want is a normal sinus wave that moves smoothly while animating its sinAmplitude parameter. I did create a wave with the help of sinCosGenerator and catmullRomInterpolation but im struggling to animate it, i am not sure where and how to correctly call the function which updates the amplitude, would be great if someone could give me a little help, i already searched the forum but did not excactly find what i was looking for. thx in advance jules Link to comment Share on other sites More sharing options...
samid737 Posted October 23, 2017 Share Posted October 23, 2017 You can vary parameters of the sinCosGenerator within update().This example might help: Link to comment Share on other sites More sharing options...
jukoor Posted October 23, 2017 Author Share Posted October 23, 2017 thanks, really helped i made it more complicated than it was. samid737 1 Link to comment Share on other sites More sharing options...
jukoor Posted October 23, 2017 Author Share Posted October 23, 2017 its already pretty nice but what i actually want is a "scrolling" sin wave which is moving like an endless scroller from right to left. You got any help with that too? Link to comment Share on other sites More sharing options...
samid737 Posted October 23, 2017 Share Posted October 23, 2017 You can try phase shifting the sine wave if that helps : Another way, which is probably less costly would be to make A tileSprite from the bitmapData and move the tilePosition.x. The amplitude will have to be fixed though. Link to comment Share on other sites More sharing options...
Recommended Posts