wordpress stats

Spring Break Hackathon Day Two

April 6, 2009

This report is late, but better late than never. So I managed to accomplish yet another 4 hours of coding. This time, I spent most of the time between SpaceFighterAce and Rubytet, three hours. The last hours is fun coding time, during which I worked on updating rbpong and writing git-downloader. Still, coding has just became very difficult for me.

Most of the time I spent on development is looking on the web and finding documentation for the libraries I am using and looking at code examples.

For Space Fighter Ace, I spent most of my time fiddling with updating my code to the latest version of Rubygame.(Although I am an early adopter most of the time, sometime I am slow to catch on) You see, the author of Rubygame saw fit to create a hook-based system, whatever that mean. The end result? I am not complaining about it. I got the code to work after squirting long enough at the only code example that contain the new event system. I just look back at it and say “how brilliant Jacius is!”.(In case, you didn’t know, jacius is the author of rubygame) Compared to the old system, the new code is a lot nicer. It meants no more long event queue methods and a really cool way to map controls to methods. I am impressed. I just wish there was an actual tutorial for primitive coder like me on how to use it. The struggle to learn how it work is worth the effort though.

As for the development of RubyTet, I thought I was on my merry way to finishing it up and releasing a new version. I was really wrong. I started the development with finishing up the changes to the shapemove class, and then wiring it up to the shapefield class, which is pretty much responsible for generating shapes. Like any good game developer would do, I naturally play-test it. I noticed that some of the tetris shape couldn’t move left or right. Pretty soon, I figured that the variables involving the calculation of the limit of movement were pretty much not making sense. I thought this must be a problem in the calculation. I wrote a few unit tests to find the bug. Turn out that the algorithm was fine. Time to go back to look at the variables for me. In one quick look, drawing on the knowledge that I learned on that one fateful day in the #ruby-lang channel on freenode, I knew that it was actually creating new array elements. Eureka!

Except it mean that I have to write new code on dealing with this bug. It also mean that I can no longer hard code the shape. It have to be flexible enough to adapt to changes in the size of the game’s playfield. The codebase cannot have reams of codes dedicated to the various configuration of the shapes for different sizes. It must be universal. It was also an opportunity for me to move the configurations to configuration files. Then, I simply started work on them.

This mean that my plan to release RubyTet today or tomorrow is ruined. At least I got plenty of time ahead of me. With luck, I just might be able to release it in time for my birthday. There’s no guarantee though.

So what happen during the happy fun time hour of development? Not much, really. I was merely updating rbpong from the deperciated EventQueue class to the new event classes for Rubygame. I finally managed to get grit to initialize a repoistory after reading grit’s documentation more carefully. The bad news is that my Grit gravy train also came to an end. I was sniffing through the documentation of grit to find a method for pulling or cloning a repository, but for some reason I couldn’t find any. This morning, a developer said that grit is probably only for managing a git repository locally. Ouch. That was depressing. Note that word probably, so he might be wrong after all.(In this context, the developer have not played with it but he thinks it is for managing repositories locally)

Overall, the second day was pretty challenging. I learn some interesting tidbits along the way. One improtant thing that should be noted: It is a bad idea to start and finish game development after bedtime. It is pretty obvious but it is not easy to implement when you’re a bad user of time, youself. Now, the 4 hours everyday is actually a pretty damn good time management techinque. I pretty much use the 4 hours development time wisely.

That’s the end of my report for day 2, boys and girls! I think day 3 is calling me to start development any time now.

Happy hacking!

~Kiba

Leave a Reply