Archive for August, 2007

A Few Games to Port

Tuesday, August 28th, 2007

Looking for some simple Cocoa games that would be easy to port to the iPhone? Look no further. Here are a few quickly written games (source is in src directory, duh) that could be easily ported by changing a few details (NSRects and IBActions, etc.). Games include Pong, Tron (single player, sorry), Breakout, and Snake. Each game has a few minor bugs (collision in Pong, adding segment glitch in Snake), but nothing big. Maybe a few more later.

What are you waiting for then? Download.
- Joe

Implementing UIPushButtons

Sunday, August 26th, 2007
Implementing UIPushbuttons is a lot like implementing a NavigationBar, you simply instantiate, set it to listen to itself for button events, and add a ButtonEvent method somewhere down there. Here’s a quick example:

Instantiating the button (make sure you declared the button in the header file):
pushMeButton = [[UIPushButton alloc] initWithFrame: CGRectMake(10.0f, 10.0f, 120.0f, 65.0f)]; [button setTitle:@”Push Me”]; [button addTarget:self action:@selector(buttonEvent:) forEvents:255];

UIKit/CoreGraphics vs. AppKit/Cocoa

Saturday, August 18th, 2007
The iPhone compiler, unfortunately, does not include any of the Cocoa/AppKit UI-oriented classes. This means your stuck with (sigh) CoreGraphics, or the CG- prefix, and the iPhone-specific UIKit with the UI- prefix, rather than the NS- (AppKit/Cocoa) classes you used to know and love. Listed below are some examples of these difference. We will begin with the rectangle structs.
NSRect nsRect = NSMakeRect(0.0f, 0.0f, 10.0f, 10.0f);
Whereas the equivalent in CoreGraphics:
CGRect cgRect = CGRectMake(0.0f, 0.0f, 10.0f, 10.0f);
By the way, nsRect and cgRect are the exact same internally. That is, the origin is defined as the bottom left corner (considering you didn’t change the coordinate plane), and the other 2 initializing components specify width and height from this point.



Saturday, August 18th, 2007
New site and hosting, expensive to say the least. Ben and I are working on getting everything up and running, so to those I promised I’d host — just hold on a few more days. Everybody just chill.

Hopefully I’ll finish this new installer application (one that won’t brick phones) soon enough. Forums and such are being set up ATM, hopefully I’ll get some Subversion repositories+access worked out as well.

Until then, we wait