Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Feature

Dropwords, Part 2

Developing a simple game

Issue: 8.4 (May/June 2010)
Author: Marc Zeedar editor-at-rbdeveloper.com
Article Description: No description available.
Article Length (in bytes): 42,633
Starting Page Number: 18
RBD Number: 8410
Resource File(s):

Download Icon 8410.zip Updated: Monday, May 3, 2010 at 7:58 PM

Related Web Link(s):

editor-at-rbdeveloper.com

Known Limitations: None

Excerpt of article text...

In the last issue I started a tutorial of how to build a fun word game called Dropwords. We got about halfway through it so now we'll finish it.

Animation

Let's begin by adding some animation and actually making the dropping letters drop. Now there are many ways to do animation -- how you handle it depends on a great deal on the specific needs of your application. For instance, a 3D action game is going to have very different animation needs than a word processor. In the case of Dropwords, it's a simple board game and its animation needs are minimal. Therefore I decided to go with a basic approach using a Timer to animate a letter tile. For a number of reasons this isn't the best technique for an action game (for one, Timers aren't guaranteed to trigger reliably and animation can be jerky), but it works fine for our needs.

We'll start by creating a Timer subclass. Add a new class to the project, call it AnimationClass, and give it a Super of Timer. Inside the class, add the following properties:

...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