In this chapter, as in all the chapters to follow, you will learn how to create a computer game using Visual Basic. Simple game projects provide a fun and engaging learning experience while you learn about Visual Basic .NET 2005.
In this first chapter, you will learn how to create the Joke Machine game. The Joke Machine game begins like most other Windows applications, displaying a window that controls the game's execution. Compared to most Windows applications, the Joke Machine game is relatively simple, consisting of just two buttons, a label, and a text box. However, the development of this game will demonstrate powerful programming techniques that make up the foundation of any Windows application.
When first started, the Joke Machine will appear on your desktop as shown in Figure 1.1.
Figure 1.1: The initial window of the Joke Machine game.
The game is very simple, containing just two buttons, each of which displays a joke and its punch line when clicked. Figure 1.2 shows the first joke displayed by the game.
Figure 1.2: Viewing the first joke told by the Joke Machine game.
Figure 1.3 shows the joke that appears when the Joke Machine's second button is clicked.
Figure 1.3: Viewing the second joke told by the Joke Machine game.
By the time you have created and run this game, you'll have learned the five basic steps involved in writing and executing a Visual Basic application.