I started using polar vectors due to ease of use for making circles of bullets and streams as in stage 2 boss and stage 5 in Subterranean Animism and I am currently polishing it up, with them I can also make spirals of bullets easily and even flower-shaped patterns (making them and then shooting them in a linear way based on the angles, not actually moving them around like Futo's last spellcard).
The draw-back is that I lose control over time the time-position relationship (or rather I haven't tried to this yet) and there are things that you just can't do as a counter for being able to do some hard stuff in an easy way, so I was thinking of having more than just polar calculations so as to be able to use two forms of making patterns. For now I'll be focusing on different types of streams, which are quite easy to do, but still need a bit of testing.
I'd like to know more about base time. My linear movements use a fixed angle and go through it by increasing the radius parameter as the program runs until the bullet goes out of bounds, the angle is either based on a point (streaming) or given (to make defined shapes before shooting), how should time come into play in something like this?
For example:
///Previously set angle.
CurrentRadius += Speed;
It gives consistent time, but if I understood well you actually use time, my algorithm uses increasing distance and a sense of a certain speed is given by the loop.
and how can sin and cos get linear movement? It's not clear to me with just looking at their function graphs (both polar and rectangular). That's all the questions I have from now.
This should be to promote my project and show results when I have them and not asking questions, but your approach got me quite curious.
Among the other member variables, my bullets have angle and a float named basetime, which says at what time the bullet has been shoot. Every time the game loop is executed, I save the frame time in a float and add it to TotalPastTime. Doing this way I have a whole set of instruments I can use to move the bullet: for example, I could make it move straight forward to the player with something like (I'm inventing at the moment):
On bullet's constructor:
angle=-atan2f(Player.Pos.y-enemy.Pos.y, Player.Pos.x-enemy.Pos.x); //Radians
Sprite.SetRotation(angle*180/PI);
And on bullet's move func:
Sprite.Move(cos(Angle)*speed*FrameTime, -sin(Angle)*speed*FrameTime); //speed is usually a raw number, not a variable
The above, when executed, makes the bullet calculate where she has to go, aiming to the player, and then, during the loop, it moves in a linear way using cos/sin for the variable angle
The basetime usually comes when I want to make more complex patterns, such as accelerating or curving ones. For example, accelerating bullets' move func could be something like:
Sprite.Move(cos(Angle)*(100+(200*(PastTime-basetime)))*FrameTime, -sin(Angle)*(100+(200*(PastTime-basetime)))*FrameTime);
In this example, I have a bullet which initially has a speed of 100 but, after a second, has reached a speed of 300.
But I also could stop the bullets for a while, (like TD fairies at the beginning and end of stage 3), and this could be easily done by checking the value of PastTime-basetime.
This is how I do it. There's only one thing left I have to tell you: Good Luck with your game!!! :)
PS. Sorry for my English, it's not my main language