Some quick notes on Vim:
Buffers are in memory representations of files (and probably other things)
You can put a list of vim commands into a file and source
it to run on buffers.
e.g. :source {script}.vim
in command mode
vim {pattern}*.{extension}
opens a bunch of files matching the wildcard into buffers.
:ls
or :argslists the buffers open.
:first:next
or
:n:prev
or
:previousor
:bnextor
:bprev:bfirst
:blast` … these all iterate through open buffers.
On Godot I completed a practice problem basd on the steering algorithm from yesterday.
I got a little stuck as the algorithm confused me.
After looking through the notes again it became more clear.
= input.axis(x) # right or left
x = input.axis(y) # down or up
y
= 600 # px per frame
max_speed = 10.0 # how jittery should the movement be to a new input
steering_factor
= Vector2D(x,y).normalized() # normalized to keep length less than 1
direction
= max_speed * direction
desired_velocity
# this part is the visual of the vector that connects from the head of the current velocity to the head of the desired_velocity
= desired_velocity - velocity # velocity is the previous velocity
steering_vector
# this part confused me. Why add to the velocity?
# We are adding the steering_vector scaled down by the delta (probably 1/60th of a seond given usual 60 FPS)
# It is also scaled down by the arbitrary steering_factor we defined above. So as long as the steering_factor is less than 60, there should be some smoothing
# At 60 I belive it would look the same as never smoothing the velocity as you are adding the difference between the desired_velocity and the current velocity to the current velocity.
# Cancel out current velocity, you are left with just the desired_velocity
+= steering_vector * steering_factor * delta
velocity = velocity * delta position