B
B
Blunker2017-02-15 08:14:15
JavaScript
Blunker, 2017-02-15 08:14:15

How to make animation on canvas?

It is required to implement sorting algorithm visualization like this https://www.cs.usfca.edu/~galles/visualization/Alg... .

I don't know what to start with. Google didn't turn up any results.
Maybe someone did something similar, let's see the source :)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Korotaev, 2017-02-15
@lekzd

Make a "record" of the sorting process using the command pattern gameprogrammingpatterns.com/command.html
put commands on the stack,
play commands by timeout , in
fact there will be something like
queue = [MoveCommand(1,3), MoveCommand(2,3), MoveCommand(3,1)]
and in the command already move the elements of the array, and start redrawing.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question