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
8410.zip Updated: Monday, May 3, 2010 at 7:58 PM
Related Web Link(s):
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.
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.