Add animation to path drawing #25

Closed
antograb wants to merge 0 commits from drawShortestPath into mvc
pull from: drawShortestPath
Owner

Not yet entirely satisfied with the result as the animation kinda lags when you increase the timer delay in MazeDrawing.java#L68. But anyway the timer and UI are thread-separated, that means that we can still do stuff in the UI while the animation is running.

Note that I changed the variable pathDrawn from boolean to int, because there was three states to represent :

  • pathDrawn = 0 corresponds to the state where nothing is drawn
  • pathDrawn = 1 corresponds to the state where we are going to animate the path
  • pathDrawn = 2 corresponds to the state where we re-draw the path which had been already animated. By that I mean that there's no need to animate the path drawing once more when it has been already drawn.

Also changed the ugly orange ovals to tiny cute circles. ^_^

Not yet entirely satisfied with the result as the animation kinda lags when you increase the timer delay in [MazeDrawing.java#L68](https://git.regar42.fr/antograb/TpMazeJava/commit/9394eb487b7e60c4815d7c614b7969defcf50e75/src/ui/MazeDrawing.java#L68). But anyway the timer and UI are thread-separated, that means that we can still do stuff in the UI while the animation is running. Note that I changed the variable `pathDrawn` from `boolean` to `int`, because there was three states to represent : - `pathDrawn = 0` corresponds to the state where nothing is drawn - `pathDrawn = 1` corresponds to the state where we are going to *animate* the path - `pathDrawn = 2` corresponds to the state where we *re-draw* the path which had been already animated. By that I mean that there's no need to animate the path drawing once more when it has been already drawn. Also changed the ugly orange ovals to tiny cute circles. ^_^
regar42 was assigned by antograb 2017-12-28 14:11:36 +00:00
antograb added the enhancement label 2017-12-28 14:12:58 +00:00
Author
Owner

If you feel like it, you can label the PR as [WIP] and fix that lag later.

If you feel like it, you can label the PR as [WIP] and fix that lag later.
antograb closed this pull request 2018-01-01 19:22:15 +00:00

Pull request closed

This pull request cannot be reopened because the branch was deleted.
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: antograb/TpMazeJava#25