Get immediate access to this and 4,000+ other videos and books.

Take your career further with a Ultimate Pro subscription. With unlimited access to over 40+ books and 4,000+ professional videos in a single subscription, it’s simply the best investment you can make in your development career.

Handle Click Events Pro

Try adding two buttons that increment and decrement the glass count by 0.5 respectively. These buttons can be smaller in size and located below the existing buttons. You can improve the UI by making the “-1” button visible only if the glass count is greater than zero.

Add click listeners to the buttons and modify the glass count accordingly. Redraw the Tile after each click and display the updated data.