I’m trying to create a closed elliptical path using Phaser.Curves.Path but can’t seem to figure it out? Anyone have any sample code? I’ve been trying to hack this with little luck.
Also, I’m wondering if it’s any more efficient to move an object along a path using a tween or to move it manually in an update method? For example, would it be a little performance heavy if I used a simple sine function to move an object around a screen by brute force re-positioning on each frame?
edit: Looks like creatingcustom tweens is not too hard at all…
Thanks @digitsensitive, that looks like a fit. My preferred approach would definitely to be use math functions to manually move objects around the screen. I guess I just want to be sure it’s not going to be too performance heavy as I plan to have quite a few bodies orbiting around the screen at any one time.
I would like to use some strange attractors to control their positions. I guess I’ll just try it out and see. The other options would be to define my own tween Ease, but I don’t know enough about how they work to do that. I’m sure I’ll find an example somewhere though…
Would using tweens be more efficient? Note that I will use a wavetable table for the sine shape so I don’t have to keep calling sin(). That should also speed things up a bit.