Ok so I found out that in AGS a character have the following properties :
- MovementSpeed : which sets by how many pixels the character should move (this amount of pixels needs to be specific to the sprite itself in order to avoid a gliding effect),
- and when "MovementLinkedToAnimation" == True this movement is not indexed on real time directly nor on frames but on changes of sprites ( "each time the loop's sprite changes, advance X pixels"),
- which means it is indexed on "AnimationDelay", which seems to set how many frames a sprite should last before changing to the following one in the loop.
So far I have found 3+1 properties that impact character movement in Godot :
- Speed : which is used in order to set by how many pixels the object moves per frame
- Animation Speed (FPS) : which sets how many sprites are played per second
- Speed Scale : which multiplies Animation Speed
The 4th parameter is line 13 of my code :
`# How much distance can the player cover in one frame
var distance_per_frame = speed * delta
# This loop moves the player along the path until he has run out of movement
# or the path ends
while distance_per_frame > 0 and path.size() > 0:
var distance_to_next_point = position.distance_to(path[0])
if distance_per_frame <= distance_to_next_point:
# If the player cannot cover distance_to_next_point distance in
# one frame then its position is incremented by
# distance_per_frame in the path direction
direction = position.direction_to(path[0])
position += direction * distance_per_frame
else:
# The player gets to the next point
position = path[0]
path.remove(0)
# Update the distance to walk
distance_per_frame -= distance_to_next_point
if path.empty() == true:
direction = Vector2.ZERO`
I tried the following :
Godot.Speed = AGS.MovementSpeed = 4
Godot.AnimationSpeed = AGS.AnimationDelay = 4
Godot.SpeedScale = 1
But it doesn't work, and I think it is because Godot.AnimationSpeed calculates how many sprites should be played per second, whereas AGS.AnimationDelay counts how many frames should a sprite last before changing.
So obviously these two can't be equal... I am very bad at math, do you have an idea of how these two parameters could be related ?