PART SIXTEEN
BUTTONS

MY FIRST BUTTON

Button Class

A few highlights in this code:

Next Day Button

Adding It To Game

Since we have a button now and are near release, make your hotkey for nextDay() a less prominent hotkey, like enter.  When a user actually plays the game, we want to avoid them mashing spacebar accidentally.

CHECKPOINT
Run your code and see...

STATE BUTTONS

A List Of Buttons

So many button subclasses!

RESPONSIVENESS

Rollover

Sound Effect

You can't make something more white, since white is the default color filter.  In my example, when the mouse is over it I make it very slightly yellow.  When the mouse isn't over it, I darken the image slightly.

SHOP ITEM BUTTONS

A Major Refactor

Class ItemButton

Refactoring Shop

At the top of the class

In init()

In renderWares()

CHECKPOINT
Run your code and see...

Mouse Pressed

Removing Unique Items

Displaying Costs

CHECKPOINT
Run your code and see...

ITEMBAR BUTTONS

A Major Refactor

Class ItemBarButton

Commentary

Class ItemBar (Revised)

Commentary

CHECKPOINT
Run your code and see...