Create a game structure that has a player name
, a location
Posn,
and a Boolean variable for horizontal?
. You can abbreviate field names.
Write a draw handler that draws a rectangle with the player’s name
inside of it (you pick a size) and then potentially rotates it 90
degrees if horizontal?
is false.
Write a key handler that flips the image from horizontal to vertical when you hit space.
Add to your key handler so any other (length 1) key that is hit is added to the end of the existing name. Advanced: make backspace work.
Write a mouse handler that changes the location of the image when you click.
Make a big-bang
to animate this action.