Due: Tuesday 12/10 10:00am

Submission name: work30_stamp

Grab the stampIt starter code from thesource. It’s a program where the user controls a circle with either their mouse or the keyboard, and can then “stamp” the circle on the screen, and create a new circle to move around. By overloading the constructor and move methods, you will add functionality to the program. Notes on the program:

  • In MOUSE_MODE, the circle’s position is set by the mouse, calling move(mouseX, mouseY). The driver function stamp is called when the mouse is pressed. This code is all provided.
  • In KEY_MODE, the circle’s position is modified based on keystrokes and other modifiers. The driver function stamp is called when space is pressed.
  • The moveMode driver variable should be changed with different keys, and then different move methods (defined below). Will be called based on moveMode

Methods to overload

  • Overload the constructor with one that only takes the size as an argument. The position should be a random valid point in the screen.
    • Modify the keypress for space so that this constructor is called.
  • For the following versions of move, add a key listener that will change moveMode and then call the correct method.
  • move
    • use n to set moveMode to NORMAL: move(int direction)
      • moves up/down/left/right based on direction.
    • use g to set moveMode to RESIZE: move(int direction, float sizeFactor)
      • moves up/down/left/right based on direction.
      • multiplies size based on sizeFactor.
      • you can pass any values you’d like to sizeFactor
    • use r to set moveMode to RANDOM: move()
      • moves to a randomly set location.