PATRICK JOSEPH BESONG: June 2007 Archives

The Power of Backwards Engineering

| | Comments (2)

As I stated in my previous post, I'm looking at recreating the Flash game 'Tonti' just to get an idea what it takes to develop such a game. Here is what I've got so far:

Tonti Game
Click on the start button (instead of typing "0").

If you want to play the original game, go here.

This is not supposed to be an exact copy. I'm just trying to emulate the same functionality. So far I was able to create the interface, make the individual movies of the character popping up, getting the keystrokes for 'whacking' the Tonti, and keeping a basic score. I was also able to make a pause button work, which was not as easy as it seems.

First off, to save time I just took a few screenshots of the original game. I roughly made duplicates of a few parts to use for each row of characters.

After doing some web research on determining how to read a keydown event in Flash, I was able to get some interactivity into it. Instead of the little mallet, I used an explosion, which I thought was a little more exciting when whacking the Tonti. The explosion consists of about 13 individual images of an explosion. I had to code it in such a way that you could only blow it up if it were showing. So when the Tonti character gets so far up, I set a variable that it is available to be hit. When it goes back down, it's not able to be hit.

I used a timer mechanism to randomly trigger each of the 9 Tontis to come up. It's not going nearly as fast as the original game, but I can change that by adjusting the timer. I did run into a problem with this. What was happening at first was that if a Tonti was coming up and its number got randomly called again, it would disappear and start over again. So I had to add a variable to tell it to skip a number if its animation was already active. Not sure how the original game pulls this off, but that's how I did it.

The pause button on the lower left works, although you have to click on it instead of typing a "0" key. It was easy enough to stop each of the 9 animations, but when you click it again to resume, that's when it got a bit tricky. I checked to see if an animation is active before telling it to play or I'd be telling them all to play.

Scoring was pretty simple. At the end of the animation sequence where the Tonti blows up, I just increment the score variable by 200 and it's displayed on the lower right.

I decided that 20 Tonti was good enough to be considered a level, so I put a counter in the timer mechanism that counts every time it fires. After 20, it kills the timer.

Not sure how much further I'll take this, but it's helped me think about how to set up a game. I'm a big fan of backwards engineering things to see how they work (or might work).

A visit to Hershey / Flash games

| | Comments (0)

On July 6 I'm planning on heading down to the Hershey Medical Center to meet the assistant professor, whom I'm setting up the demo Flash simulation for. I had a long chat with him on the phone and got a clearer idea of what he was trying to accomplish. He's looking to be able to have people who are not Flash developers be able to create simulations without too much trouble. I explained to him that the work would be all up front in getting the Flash file created that would run the sim, and that after that was created, it was basically a matter of creating graphics (backgrounds, photos, images) and inputting data into a FileMaker DB. Once a flow diagram was set up, this could easily be done by almost anyone with a little knowledge.

I also began to look at how to make games in Flash. I thought by doing a knock-off of a popular Flash game, I might gain some valuable experience in game creation. I am taking the game Tonti and sort of backwards engineering it. This is what I had to do for the All-Sports Museum Kiosk I've been working on. Tonti is sort of like "Whack-A-Mole", only you use your number keys to "whack" the Tonti character that emerges from one of the 9 holes. Just to save time, I took a few screenshots of different elements of the game and dropped them into Flash. I was able to get this to the point where the Tonti characters would emerge from their holes at random. It was actually a bit easier than I thought once I started poking around in Flash. Maybe I can eventually make a game that teaches you how to type with this concept.

On the Right Track

| | Comments (1)

The assistant professor from Hershey who I'm doing the simulation proof of concept for finally got a chance to look at it and said he liked what he saw. We'll be getting together via phone to discuss the project in more depth as he can't come up to University Park till some time in August. So I'll find out soon which direction we'll go next with it.

In the meantime, I've decided to retrofit the work I'd been doing for the PSU All-Sports Museum to take advantage of XPath in Flash. The sports museum has me working on a touch-screen kiosk (a side job I'm doing on my own time at home). I've pretty much recreated the functionality of what was done for the other team sports kiosks, which were created in Flash. The kiosk I'm creating has to do with media personnel who have covered Penn State sports. I originally did it to match the way they did the other kiosks, using external text files, but after seeing what I can do with XPath, I was able to eliminate all the text files that they previously used by exporting one XML file from FileMaker Pro. I had to rethink the way I handled the info, but it really wasn't too difficult to make the shift. This will pay off tremendous dividends for the Museum personnel who need to add data to this kiosk in the future. One of the coolest advantages is that in FileMaker it's as easy as clicking a button to alphabetize all the records by last name, which I needed to do for the interface. Once I get some real content from them I'll be able to share the interface. If they someday decide to go this route with their other kiosks, they could serve all their content from a single FMP database server. This project has really turned into a great vehicle for professional development for me.

The Strandbeest

| | Comments (1)

At the NMC Conference in Indianapolis (IUPUI), I was fortunate enough to see a Strandbeest, a work of engineering/art created by Theo Jansen.

The Strandbeests are kinetic scultures that look like they're made out of 3/4" pvc water pipes held together with string and wooden pegs. They are quite marvelous to see. They almost look alive, like walking animal skeletons. They remind me very much of some of the robots you see in the last Star Wars. A gust of wind is all they need to make them skuttle across the ground. The movement looks so very fluid and natural that it's almost scary.