Jan A

  1. How would you create this scene?

Ellipse width animation

  1. Make an animation where moving the mouse horizontally changes the width of the ellipse. The ellipse width should be 0 when the mouse is in the middle of the screen (x=250). See below for check-expects.

    • When the mouse moves to x=400, y=75, the width of the ellipse is 300. Write a check-expect.
    • When the mouse moves to x=250, y=120, the width of the ellipse is 0. Write a check-expect.

Stopping animation

Now add code so that clicking in the blue circle makes the animation stop. We will do that by making the width negative when the animation is supposed to stop.

  1. Write a check-expect showing that when there is a button-down event at (10,170), the width is -480.

  2. Modify your mouse-handler so that clicking anywhere inside the blue semicircle makes the width negative.

  3. Create a game-over? function that returns true when the model is negative.

  4. Add a “win screen” that shows “DONE” on top of the regular scene.

Last modified August 18, 2023: 2022-2023 End State (7352e87)