Welcome to my Programming Blog...

I am currently working on a couple of projects: An original game called "Implosion" which I am porting from Flash to the iPad, and a remake of Q*bert in Python (pygame), as part of the class I am teaching. Please feel free to use the "Labels" (at right) to follow a specific project or theme. If you are one of my Python students, I recommend that you check out the Python thread.

Tuesday, September 14, 2010

For want of a nail...

"Hubris!" a friend of mine exclaimed as he watched the pomp and circumstance of a recent pep rally at our school as we prepared to face a team better prepared than our previous opponents. "Hubris!"

I mention this, because I was congratulating myself on how clean my code was. When I wanted to add a new feature - hints for the player who is stuck - it was a relatively easy addition to make because my code was broken down well and documented. "Hubris!"

As you might guess, I've been hunting a bug, and finding others along the way...

The bug I was after was one that was causing the program to freeze and crash whenever the chips needed to disappear from the back of the screen. I had just been adding in the hints code and was in the process of fixing a glitch where some pieces wouldn't stop spinning. I looked all over the game manager code where I had been working, ran the debugger to isolate the line, checked and double-checked the memory management code, even ran instruments!

I found two tiny memory leaks in Instruments, but they didn't fix my bug. Finally, after the better part of a week of searching, I found it tonight. It was a change inside the Chip class, where I had been modifying the "description" method to add one mo piece of information - and pit the new code outside of the square brackets. Somehow, it escaped the debugger, and caused me nightmares.

Once that tiny line was repaired the problem went away, and I was able to fix my unstoppable spinning chips in no time at all. Fixing the leaks seems to have made some memory warnings go away, as well!

Sure enough, our football team was down by 16 points going into the fourth quarter. (I must confess, I had gone home already....) But you know what?

They rallied back and won.

Just like they are going to next week, too.

- Posted using BlogPress from my iPad

Monday, September 6, 2010

The joys of a long weekend

Got some work done this weekend - labor day has been good to me. I got the advanced pieces finished in blender and started in on a hints system.

The pieces came together faster than I had expected, and I have come to realize that I was dreading the fight with Blender more than I realized. I was avoiding the project. I am glad to get over that hurdle!

At Clay's suggestion, I added in a feature to show possible moves to people who were stuck. Right now, it scans the current selector through the whole grid, in every orientation to see whether there are moves. Whenever it finds a working move, it picks one square at random from the four selected and starts it spinning.

Clay's original suggestion was to make this happen when the player does a three finger double-tap. However, I am finding that this interferes with the single-finger double-tap that is used to make a selection, usually resulting in a scratch. It also sometimes got interpreted as a swipe, selecting the next chip. I think I will change the controls so that a horizontal three-finger swipe passes the selector, and a vertical three-finger swipe shows the hint. I may also have the spinning "time out" after a little while.

I still need to balance the difficulty level - the rings are a non-issue in the game - they disappear too quickly. At the same time, I don't want to stress out the beginning player.

I have a couple of lingering bugs: the spinning chips don't fall inwards when the time runs out, and occasionally don't stop spinning when there is a new selector. But we are closing in!

Wednesday, September 1, 2010

Back in the swing...

I had a great trip last week with the freshmen- on the drive home I gave a colleague a preview of Implosion. Rave reviews! (He even foisted it on some freshmen...)

He also gave me an opportunity to talk up some ideas for balancing the difficulty level and aiding the beginning player. Clay had some great ideas!

Tonight, I finally had some time to work on it again, and I've been tackling blender once more. I now have the shapes drawn for the extra selectors. I just need to add in the fills via Photoshop, and we'll be in very good shape.

I had hoped to get this app to market by the end of summer, but that just wasn't meant to be. I'm glad to get some of this blender business behind me - it will be good to get back to my element.

- Posted using BlogPress from my iPad