Animation Practice

Practice writing big-bang code and identifying common errors.

Progress bar 1

Make a solid purple bar that starts in the middle of the left side of the screen and grows to the right at a constant rate.

  1. Model

  2. Draw handler

  3. Tick handler

Add in a feature so that the bar shrinks when you wiggle the mouse.

(Solution code)

Errors #1

What is wrong?

The variable indoors is an indoor picture.

(define indoors ...)
(define model (overlay pic:stick-figure 
                       (empty-scene 300 200)))
(define (tick-h img)
   (overlay img indoors))

Errors #2

What is wrong?

(define start pic:stick-figure)
(define tick-h (beside (square 10 "solid" "white") start))
(big-bang start
          (on-draw show-it)
          (on-tick tick-h)
Last modified August 18, 2023: 2022-2023 End State (7352e87)