Career | Contact |  

Subscribe: RSS Feed
Comments:

iQuickBlock for iPhone

Apr 30, 2008

Posted by: Kamil Trzciński, Software Developer

iQuickBlock is a simple, intuitive yet extremely addictive iPhone game. It has been developed in a few hours of programming time during the Newest Mobile Technologies Lab at the Warsaw Technical University. It is one of the first Polish iPhone applications, and to our knowledge the very first Polish game written for this device. It has reached up to this day an astonishing 82331 (still counting) of downloads!

 

This might be even more surprising if you consider that the game was written specifically for the needs of explaining Objective-C and iPhone Dev to other BRAMA members. The total development time was only 6 hours, using the Cygwin iPhone Toolchain and Notepad++. The testing phase using WinSCP and PuTTY included.

From the technical side all the rendering is being carried out using the UIImageView, whose state is refreshed several times (on the order of tens) per second. The smooth graphics rendering was left to the hardware acceleration, it handled it with astonishing grace. Having some experience in GUI coding, I found the iPhone "way of doing things" much simpler than for example the S60 AVKON.

For example, popping up a dialogue asking for the player name is just a matter of the following few lines:

NSArray *buttons = [NSArray arrayWithObjects:@"OK", nil];
UIAlertSheet *alertSheet = [[UIAlertSheet alloc] initWithTitle:@"Game over" buttons:buttons defaultButtonIndex:1 delegate:self context:self];
[alertSheet setBodyText:[NSString stringWithFormat:@"Your time is %.1f second(s)", m_gameTime]];
[alertSheet addTextFieldWithValue:nil label:@"Your name"];
[alertSheet popupAlertAnimated:YES];

The same is true for the iPhone smooth transition effects, using the UITransitionView class:

typedef enum {
UITransitionShiftImmediate = 0,
UITransitionShiftLeft = 1,
UITransitionShiftRight = 2,
UITransitionShiftUp = 3,
UITransitionFade = 6,
UITransitionShiftDown = 7
} UITransitionStyle;
[m_transitionView transition:UITransitionFade toView:m_menuView];

This seems unbelievably straightforward if you consider the visual effect on the screen itself.

Have fun coding, have fun playing!

Credits for the game idea go to Mariusz Ostrowski and Marcin Maksymiuk who developed the game for UIQ some time ago. You can read about it here