O'Reilly logo

Learn Game Programming with Ruby by Mark Sobkowicz

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Add Visual Feedback

When you play Twelve now, all the action happens when the mouse button is released. When you click on a square and slide the mouse around, nothing appears to happen. In this section, you’ll add highlights to the squares to give users some visual feedback about the move they are making.

First, as the player clicks on a square to begin a move, add a white square highlight to the starting square, as shown in the following image.

images/twelve/start_square.png

This square remains highlighted until the player releases the mouse, reminding the player which square is making the move.

As the player moves the mouse around to different squares, the square that the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required