.NET Zone      
 
Smack the Santa: Creating a Game in VB.NET

Out with the old, in with the new. VB.NET makes it easier than ever to create dynamic, interactive applications.
by Justin Whitney

f the many, many new features of Visual Basic .NET, one of the most intriguing is the ease with which you can create dynamic forms. Generating a completely new and unique form on the fly now requires nothing more than instantiating a new form object and throwing the switch. In fact, instantiate a few controls, hook in some procedure to handle their event processing, and you can create an interactive application on the fly.

As you step through the process of creating this demo application, you'll learn how to craft familiar features, such as generating random numbers and using a timer, in new ways, and then learn how to implement those features in a dynamically generated form using equally dynamic controls and event handlers. Lastly, I'll describe some of the features I did not include in this demo to give you a sense of where you can go from here, and perhaps inspire some creative enhancements.

To underscore the seriousness of this new functionality and the power it can add to your mission critical applications, I've chosen a particularly dry, straightforward business tool as the demonstration: Smack The Santa. Santa is trying to stuff coals into your stocking! You have to teach him a lesson. After choosing your game options on the control screen, you'll generate a blank screen on which Santa will pop up in random places holding a stocking filled with coal. Smack him before he gets away! The more times you smack him, the higher your score. Figure 1 shows Santa as he appears on the form.


Figure 1: The Smack the Santa game form. This form doesn't exist at design-time. The control form creates it dynamically based on user input.

 
The Smack The Santa Control Form

Introduction The Smack The Santa Control Form Global Variable Declarations
The Popup Mechanism Smack That Bad Boy!  


 





 TALK BACK
Have the problems associated with browser incompatibilities, technology advances, and .NET killed off DHTML and browsers for distributed application development? Let us know in the talk.editors.devx discussion group.
Click here to Join
Get the code for this article

The .NET Framework SDK

.NET Events

Grouping Data in Collections





 
Sponsored Links

Advertising Info  |   Member Services  |   Contact Us  |   Help  |   Feedback  |   Site Map
Jupiterweb networks

internet.comearthweb.comDevx.comClickZ

Search Jupiterweb:

Jupitermedia Corporation has four divisions:
JupiterWeb, JupiterResearch, JupiterEvents, and JupiterImages

Copyright 2004 Jupitermedia Corporation All Rights Reserved.
Legal Notices, Licensing, Reprints, & Permissions, Privacy Policy.

Jupitermedia Corporate Info | Newsletters | Tech Jobs | E-mail Offers

Copyright Information/Privacy Statement