I am new to coding. I have a top-down ship object whose movement I am trying to make work. I have it moving at a constant speed the moment the game starts, and I have mapped it to move left when the left arrow on the keyboard is pressed, and right when the right arrow is pressed.
The ship has a large sail and a small sail. I would like to try to make it feel like the rotation of the sail is turning the ship, and the arrow keys are turning the sails.
Right now the ship and the sails turn at the same time. I would like to make it so that the sails rotate up to a certain degree relative to the ship, and then stop (since ship's sails don't rotate 360 degrees in real life.). Perhaps at 90 degrees relative to the ship.
I would like to make it so the more the sails rotate the faster the ship rotates.
When the sails get rotated back to zero the rotation of the ship slows until the sails hit zero degrees, at which point the ship is no longer rotating.
Here is the current code:
var rot_dir = 0
rot_dir += 1
rot_dir -= 1
rotation += rotation_speed * rot_dir * delta
velocity = Vector2(speed, 0).rotated(rotation)
Any ideas on where I can start on this?