Answer the question
In order to leave comments, you need to log in
How to make a smooth movement on the map in JS after calculating the A * algorithm?
The link below implements the algorithm for finding the shortest path for the ship, when the ship reaches the finish line, the map shifts to position the ship in the center of the screen. Is it possible to implement smooth offset shift?
Any ideas are welcome, I tried to impose a second layer on top of the algorithm calculation with smooth rendering, but the ship after the finish jumps to the center even if the map is smoothly moved on top, so nothing sensible came out.
https://codepen.io/Electromax/pen/JjOgMmm
https://codepen.io/Electromax/pen/JjOgMmm
Answer the question
In order to leave comments, you need to log in
you need to move the map when moving the ship - you calculate the difference between points A and B, divide by the number of steps. But your approach is not viable - read about background color maps.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question