Chapter 24. Creating a Browser Game

<feature><title></title>

WHAT YOU’LL LEARN IN THIS HOUR:

  • Creating a custom user interface component

  • Using recursion to examine adjacent buttons

  • Generating random numbers

  • Setting values with the ternary operator

  • Loading a graphic into an applet with a URL

  • Preparing an applet for deployment on the Web

</feature>

Though Java is no longer the most popular programming language for browser-based games, losing that crown to Macromedia Flash from Adobe Systems, it remains a capable platform for creating games and other interactive presentations.

During the final hour, you create the Banko applet, a puzzle game that’s implemented using Swing with custom buttons and graphics.

Designing the Game

The development of the Banko game ...

Get Sams Teach Yourself Java™ in 24 Hours, Fifth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.