Special

Clearance Sale!

We've been publishing for over five years now and it's time to clear out our inventory of back issues, so we're slashing prices!

RBD Magazines

Check out this amazing clearance sale of all our past issues. Missing some issues? This is a great time to complete your RBD collection. Save up to 40% off the regular price of our printed back issue packages. These prices are only good until the end of the year May 2008 and supplies are limited, so place your order today.

Article Preview


Buy Now

Print:
PDF:

Beginner's Column

Welcome to the REALbasic Developer Magazine Beginner's Corner!

Issue: 2.2 (October/November 2003)
Author: Thomas J. Cunningham
Author Bio: Thomas is a hobbyist programmer who enjoys sharing the RB loving with others ... His online RB Beginner tutorial has had over 20,000 hits!
Article Description: No description available.
Article Length (in bytes): 6,416
Starting Page Number: 30
RBD Number: 2213
Resource File(s):

Download Icon 2213.sit Updated: Friday, October 17, 2003 at 12:45 PM

Related Web Link(s):

http://support.realsoftware.com/listmanager/

Known Limitations: None

Excerpt of article text...

This month's column is part two of writing a simple dice game of Craps. Last issue, RBD 2.1, we laid out what we were trying to accomplish in our little game. I finished up with the opening window obtaining our user's name and placing it in a global variable named theUsersName. This variable resides in a module named "PlayersName". We will continue our project by implementing some Methods to make our "GameData" class handle the rules of our dice game. These methods will reside in our MainWindow. See Figure 1 for what the user interface looks like.

Craps Part Two

Our Craps game, like most programs you will write in RB, needs to establish some properties. Like most programs you will write, your main window will keep track or manage the classes associated with the game. The best place to get things going is to write an initialization method on our aptly named MainWindow. This requires only one property of our window, mGameData As GameData. Our "Init" method will instantiate an instance of our custom GameData class and set up some of the default settings for our game. The method looks like this.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com