Can someone help me learn how to add animation so that mario actually moves to cross the finish line in slides 1, 5, and 9?
This link has slide 1 with added animation and coin count.
- Mario lives in three states: an initial point, equation 1 and equation 2, so there needed to be three of him, but at three different intervals of time.
- Show/hide features occur on lots of items (line segments, coins, states of Mario), so those needed to be separate for each item. There’s a table with the points for the coins, which helped immensely with the code required to hide the coins and add the score.
- Mario needed to move through time, so the variable “a” helps him do that. There’s a speed multiplier “r” on go.timeSincePress(11) – note that 11 is needed, because the default is 10, and Mario might not cross the finish line.