Archive for the ‘Tutorials’ Category

Protocols all the way down

Wednesday, June 15th, 2016

As a programmer, one of the things I like to argue against is the concept of “magic code”, code that works because of some unseen bit of code elsewhere. In iOS, the principal is exemplified by “magic” methods you can include in various subclasses that do rather important things. Want to handle touches in your UIView? Just implement the method touchesBegan:withEvent:, touchesMoved:withEvent:, touchesEnded:withEvent:, and touchesCanceled:withEvent:, and you’re good to go. Want to set up your UIViewController‘s visual layout? Make sure you do so in the layoutSubviews method.

But how do you know about all these magic methods? This is definitely one of the questions that I found the most difficult when I first began iOS development. Learning about all this magic is basically the same thing as learning iOS development. Knowing Apple’s APIs is how you develop iOS apps. Knowing their quirks is how you get to be an expert.

But if you’re just starting out, it’s important to know that most of these magic methods are (generally, not always, but generally) defined in a protocol. When an object conforms to a protocol, it basically says that it (or one of its subclasses) will implement some set of methods. Want to know what protocols UIViewController conforms to? In Objective-C, you would simply open up its header and check it out. (Of course, a protocol might be defined even further up the chain, in one of the headers for a class the view controller inherits from.)

But how do you figure out what protocols a class conforms to in Swift? As near as I can tell, the only way is to open up Apple’s documentation. This seems like it would not be enough, since you might be working with a non-apple framework, or worse… it is possible (gasp) for Apple’s documentation to be spotty or outright incorrect. (I’ve done a few google searches, and read about 20 tutorials and blog posts, and I still don’t know how to figure this out from code alone, so I’m really asking this question. I’ve also started a stack overflow question on the topic.)

I don’t want this to be a “I think Objective-C is superior to Swift” post, but I do think there are legitimate reasons for header files, and this is one of them. Once you get beyond a certain level of iOS proficiency, poking around in those header files is akin to using the “view source” as an intermediate web developer. It’s one of the ways you learn how other people approach a problem.

How to play the game Go

Wednesday, January 27th, 2016

I tweeted this idea the other day:

Book idea: popular board game rules re-written with the 1000 most common words รก la Randall Munroe’s Thing Explainer.

Go is one of the most elegant and simple games around, yet the rules are often misleadingly complex. So without further ado:

How to play the game Go

Go is played on an area made of 19 lines going one direction, and 19 lines crossing them going the other direction. Black places first, and then black and White take turns placing a piece of their color on a space where any of the lines of the game meet. Once placed, a piece may not be moved to a different space.

Any pieces of the same color next to each other form a group. Only pieces on spaces exactly next to one another (on the game lines) can make a group. A group can be as small as only one piece. Groups may be made larger by placing another piece next to any of the pieces already in the group.

If White puts pieces on ALL the spaces next to a Black group, white takes the black pieces in that group out of the game. Same for black. Those pieces become points for the player that took them.

No player can place a piece that would make the game look like it looked after their last turn.

After both pass, each player points out any pieces they will be taking from inside their groups. If the other player doesn’t agree, the player must keep playing to take them.

Each player adds a point from each taken piece, as well as a point for each of their pieces still in the game, and finally a point for each empty space surrounded by their own groups. The player with more points beats the other player.

Notes:

1. I wrote this using The Up-Goer 5 Text Editor.

2. Obviously this is missing some of the important strategies that are included in any decent set of Go rules. Additionally, most rules of Go are complicated quite a bit with terminology that is not actually important to play, but might be important if you want to actually talk with anyone about your game. This is not usually a barrier to playing if you have someone to teach you, but if you are trying to learn from rules, it can be unnecessarily frustrating.

Edited (2016-01-28)

3. Removed the suicide rule, which as Matt pointed out is not universally accepted. (Incidentally, Matt taught me to play go, way back in the day.) I originally wrote it: “Black can not place a piece so that White would take it without playing another piece. White can not place a piece so that Black could take it without playing another piece.”

4. Re-worked capture paragraph. Less verbose and simpler.

5. Added paragraph about passing, re-worked the last paragraph a bit to explicitly count all stones. This is more consistent with New Zealand rules, which seems sane.

6. Removed “That’s it.” from the end. That was just silly.

Q&A – Porting Board Games to Digital

Tuesday, December 16th, 2014

I recently answered a short barrage of questions by some non-technical folks researching the business feasibility of board game conversion. Since I gave them these answers freely, I thought I would also post them here. This is all based on my own personal experience, so feel free to exercise skepticism and I absolutely welcome your thoughts or differing opinions in the comments below.

1. What resources estimates and how much time do you feel is needed to do a strategy board game conversion to digital?

The answers for this question are as varied as the answers to the question “how much time is needed to do a mobile game?” In my experience, if you’re paying your programmer(s) what they’re worth (which is not a given in the gaming industry), you’re probably looking at a budget somewhere between 30k and 120k. Less is certainly possible with an experienced team, maybe with a code base they’re reusing, but it would raise a red flag for me. (I get a lot of potential clients who come to me with 2-5k, and I politely tell them that we can possibly make a prototype without graphics for that much.)

2. If using Unity as a gaming language, what do you think is involved in porting to another platform say from iOS to Android or vice-versa?

I am familiar with unity, but no expert. (So take this with a grain of salt.) My feeling is that android is more work, what with supporting all the different screen sizes and hardware/processor idiosyncrasies, so if you’ve already done that work, porting to iOS should not be that much more difficult. (Depending on the project, of course.) Going from iOS to android on the other hand could take longer, especially for complex games. (It’s going to depend on how many screens or “scenes” you’ve got to prepare in unity.)

3. Are you aware of what the maintenance/support costs would/could be, if so what do you believe is involved?

This is a great question! Not something a lot of clients think to ask. It’s easy to throw something in the App Store and forget about it, which is exactly what everyone else will do too.

There are obviously diminishing returns though, so I recommend planning a release with at least one maintenance update about a week or so after the initial lunch, and maybe evaluate then whether it’s worth doing another “feature” update a couple of weeks to a month later, also with a follow up maintenance update if your budget can stand it. If the game is still doing well at that point, it’s a good idea to plan to spend some time and push out littler updates as frequently as you can, more for marketing purposes than for any development related reason. All of this will require developer involvement, but it’s the person crafting marketing and messaging that should be spending the most time after launch. I generally think this is underestimated, and can easily be a full-time task.

4. Do you have an idea of hosting (storage/bandwidth) costs?

This is only relevant if you are hosting your own server for some reason. The game should have a website, which is another often overlooked marketing piece, but it will cost far more to create that than to maintain/host it. (Hosting fees shouldn’t run more than $20/ month, or you’re probably getting ripped off somewhere. I pay $5/month + $10/domain, but that comes with doing mostly my own support.)

If you ARE hosting your own backend multiplayer server, you can think of it as another domain name. (It definitely cost you more up-front to develop, so make sure your dev is including that in their estimates.) And unless the game is super successful, most hosting plans should include enough bandwidth. If you get to the point where you are paying ala cart for bandwidth, it still shouldn’t be more than a handful of dollars unless you’re at an extreme end of the spectrum, which is a problem you wish you will have.

5. What’s your thoughts on the digitization of family board games, and what may happen, and when?

Well, “family board games” is a term that might mean a bunch of different things, but here are some initial off the cuff thoughts:

a) it’s already happening to some degree, see Monopoly, Scrabble, Jenga.

b) The family market is much larger than the hobby market, but much tougher to crack. Quality is going to be a very important consideration, as is ease of use and first-run experience, including tutorials and teaching.

c) It’s possible that the aforementioned digital game examples are mostly getting played by board game hobbyists, rather than the general populous you’d expect to be playing a family game, which would be hard to prove either way unless you are the publisher of one of those games.

d) In general, (this is advice I like to give to anybody thinking about physical game conversion), the advantage that board game conversions have over their fully-digital counterparts is that there is already a population that knows about that game and to a lesser extent how to play that game. So the bigger that group, the bigger your advantage. How successful your board game conversion will be is very much influenced or enhanced by how successful a game you are choosing to convert.

6. Are you familiar with Steam, and would you recommend porting or building for that platform?

If you want to target desktops (OSX, Windows, or Linux), then I would highly recommend building working with Steam. I cannot make a recommendation about whether those platforms are viable for board game conversions in particular. Steam is a bit like Apple’s App Store and Game Center rolled into one, but cross platform for desktop games. There is an API that you as a developer can write to, and implement Steam achievements and various other social offerings.

7. Do you feel the effort to port from say Android/iOS phones requires more work to port to Tablet versions as well, or not?

Generally there is a portion of every project devoted to UI work. The amount of time spent will be different for every project, but generally I think it’s a higher percentage of the project for games than other application types. Let’s say, for a game, 50% of the development effort was put toward UI work. If you had only developed for one screen size at that point, you might have to re-do or at least re-touch much of that work. If you plan from the beginning of the project for multiple screen sizes, you can save yourself a lot of pain in “porting” to a different screen size, but it is still more work, no doubt about that.

8. What about PC/Browser porting, are you noticing or see the need/demand or value in doing that, and if so are you familiar with the effort in that case let’s say after a mobile version has been completed?

I do see this happen from time to time, though not with a lot of board game conversions. My concern would be monetization, since the folks who play web-based games are used to getting their games for free, and you have to have a very large active userbase (in the hundreds of thousands, from what I understand, although I’m no expert) to make money with advertising alone.

9. How many people do you believe is needed to convert and maintain a board game digital conversion, and what roles?

For a “full featured” conversion, I see the following needs:
– Programmer/developer
– Artist/graphic designer
– Sound Effects person and Musician (often can be the same person)
– Some kind of project manager or person making feature decisions
– A person (or team!) in charge of marketing

I have worked on a lots of projects where there were a couple of developers who split duties. This includes several apps with Tysen Streib, who would expertly craft the AI and game logic, while I handled all the rest of the application, including ultimately integration of his code into the project.

Another optional role I’ve found myself filling briefly at the start of smaller projects is that of UX designer. It is always nice to have a blueprint to work from, and good wireframes can really speed up development as well as help keep your team on the same page if there are multiple developers.

The mix and makeup of all of these roles will be different on every team, no doubt. There are certainly some indie developers who tackle all of these tasks for every project! I’ve found that keeping scope small is always a good thing, work toward manageable milestones, and you’re less likely to be surprised by how long something takes you to complete.

NSNumber+XYCoordinates

Tuesday, January 21st, 2014

So I occasionally have the problem where I want to store a bunch of x,y coordinates. I have solved this a number of ways in the past, but most recently had the idea of writing a category on NSNumber that simply stores two 16 bit integers, bitshifted together. So without further ado, here’s the github project for NSNumber+XYCoordinates.

My first version of this I couldn’t get negative numbers to work, but after some patient binary math explaining today at the coffee shop from my friend Matt, I finally got it to support numbers between -32767 and 32767.

Essentially, my category just adds the following methods:

NSNumber *xyNum = [NSNumber numberWithX:10 andY:10];
int x = [xyNum xValue];
int y = [xyNum yValue];

This seems to work pretty great, and is way less annoying than my previous favorite technique, which was to convert between NSString and CGPoint all the time.

So I got to thinking tonight… this should be fast, right? But I have no idea how fast, really, or how to compare it. So I wrote some test cases. Each of them assigns and then reads back out again some number of sequential integers using various techniques that I’ve used in the past. I compiled the following lists for different numbers of values:

100 Values
CGPointToNSString – size of 100 string objects in multidimensional array is 2263 (0.002 seconds).
NSDictionary – size of 100 objects in NSDictionary is 2413 (0.001 seconds).
NSSet – size of 100 objects in set is 1545 (0.004 seconds).
NSNumber+XYCoordinates – size of 100 objects in multi-dimensional array is 2033 (0.001 seconds).

10,000 Values
CGPointToNSString – size of 10000 string objects in multidimensional array is 241803 (0.162 seconds).
NSDictionary – size of 10000 objects in NSDictionary is 289593 (0.076 seconds).
NSSet – size of 10000 objects in set is 199798 (0.044 seconds).
NSNumber+XYCoordinates – size of 10000 objects in multi-dimensional array is 203503 (0.046 seconds).

1,000,000 Values
CGPointToNSString – size of 1000000 string objects in multidimensional array is 31702088 (10.187 seconds).
NSDictionary – size of 1000000 objects in NSDictionary is 38735561 (121.886 seconds).
NSSet – size of 1000000 objects in set is 25866828 (118.003 seconds).
NSNumber+XYCoordinates – size of 1000000 objects in multi-dimensional array is 25919832 (114.918 seconds).

You see that the technique compares favorably against CGPointToNSString, at 100 and 10,000 values, but somehow, the CGPointToNSString technique just blows it out of the water in terms of speed when we get to a million objects. (Still much smaller though.) I don’t fully understand this, but I guess maybe the C API is faster at high volumes? Let me know if you think you might have some insight!

How long does it take to make an AdHoc build?

Thursday, December 5th, 2013

An AdHoc build is how you get iOS apps onto an Apple device without going through the App Store. They are typically used for testing. I was asked this question recently, and spent 15 minutes writing up this reply, so I thought I’d post it here. The obvious caveat is that it can of course vary from project to project. A bigger more complex project has more “moving parts” that can need fiddling with when creating a build.

So… How long does it take to make an iOS AdHoc build?

I use TestFlight to distribute my AdHoc builds, and typically, I tell clients an AdHoc build takes between 15 and 30 minutes to complete. Thankfully this work “stacks” quite a bit, so doing a few of them at once might only take 20 or 30 minutes. This process basically just involves opening the project, verifying a few settings related to provisioning profiles and “targets”, building an “Archive” of the project, uploading the new build to TestFlight, and writing some release notes as well as picking the users to receive the build. (Thanks to the awesome TestFlight OSX app, those last two steps can be done while the upload is in progress.)

This assumes, however, that all the devices are already registered with TestFlight. Everything takes longer when I need to add additional devices. This stacks too, so adding 1 to 10 or 15 new devices only takes another 15 or 20 minutes. The main additional thing that I need to do in this case is upload the device identifiers for the new devices to Apple’s provisioning portal, and download a new (or updated) provisioning profile that includes those new devices. This additional work has to happen BEFORE I can make the AdHoc build for those devices.

What I find frustrating is when all these tasks are split up over the course of hours or days. For instance, when I’m asked to send a build to some new individual, but they’ve never used TestFlight, and aren’t yet registered there. Then I have to send them an invite, wait for them to accept the invite, wait again for them to register their device, then finally I can get their identifier and begin the process. This means either waiting for the new person before creating the build (sometimes this can take days, of course!), or just creating two builds, one with the devices I already have, and another when I get all the important information from the new person. Considering the adage that a “a 15 second interruption results in 15 minutes of programmer downtime” (which is more or less verifiable), these build requests can really add up to lost productivity for me.

One final note about what AdHoc builds are not.

After an app is in the app store, unless you are testing a new version, you should really be using that version, and not an AdHoc build. There are many reasons for this, but notably: 1) AdHoc builds will expire when the provisioning profile expires. 2) You get the peace of mind that what you are seeing is what your users are seeing. 3) You will get the updates via the app store, as your users do. 4) You can instal the app on multiple devices without needing to provision all of them. Don’t forget about using promo codes to get “free” versions of apps to your testers or employees after an app goes live! (In my experience, you rarely use all of them for press as you should, and you get a “fresh” batch after each update anyway.)

AdHoc builds are an integral part of iOS app development, but creating them is annoying to me because it’s not programming. Of course, neither is wring this blog post.

How to change the color of a transparent image in iOS

Sunday, January 6th, 2013

This is probably as good a time as any to mention the next project I’m working on. It’s a turn-based (yes, asynchronous) board game. I decided to work with an existing game, because I wanted it to be really awesome, but also really simple. It’s an abstract game that is well respected in some circles. (I’m not going to reveal which one just yet.) Anyway, I’m working closely with the game’s designer, as well as with the same AI programmer I worked with on For The Win. The main goal of the project is to get the async code really solid, so I can feel like I really understand how it works, and re-use it in future projects.

Anyway, I think I’m also going to try something I’ve wanted to do before, and that is implement a variable color scheme for the app. Essentially you’ll be able to change the app’s background color, and that will also programmatically change the color scheme. I spent about two hours and had the basic color change functionality working pretty great with some code based on an already pretty great open-source color picker.

Anyway, one tiny piece remained… I would need to be able to programmatically tint images I get from the designer on this project. He’s going to give me some icons and other assets that we’ll no doubt want to change colors along with the rest of the app.

Some unknown number of hours later, I’ve got a solution. The number of hours is probably around the same as the number of lines of code in the solution. Here are those lines, implemented in the drawRect: method of a UIView subclass with a UIImage property named image, and a UIColor property named colorToChangeInto.


CGContextRef context = UIGraphicsGetCurrentContext();

CGContextScaleCTM(context, 1, -1);
CGContextTranslateCTM(context, 0, -rect.size.height);

CGImageRef maskImage = [self.image CGImage];
CGContextClipToMask(context, rect, maskImage);

[_colorToChangeInto setFill];
CGContextFillRect(context, rect);

I hope this is fairly straight forward. These few lines stand on the backs of many stack overflow answers. (And I did actually write this up into a question of my own at some point.) None of the other answers were exactly what I needed, but several of them got me close. In the end, I was super frustrated because it really seemed like I should be seeing what I wanted to see, but the background of the image was black… turned out I was instantiating the image in IB (in a storyboard), but I hadn’t set the background color. Somehow that defaulted to black. That particular issue probably wasted me an hour or two.

And then writing this blog post… another half-hour, at least.

MailChimp signups from iOS – How to add a subscriber to a MailChimp Group

Tuesday, July 10th, 2012

This week, I’ve spent some of my time integrating MailChimp into the client work I’m doing. I found some of the documentation lacking, and there is no example for how to add your email signups to a MailChimp’s list “Group”, so I thought I’d document that here.

(Astute readers who are actually reading from chesstris.com will notice the fact that I’ve got a MailChimp signup form on Chesstris.com also. I haven’t done anything with it, and so far, I’m the only person who has signed up, but it’s there. I’m still sort of trying it out.)

MailChimp has an iOS SDK they call ChimpKit, which is available up on github. In general, it’s a great SDK, but the README has some installation instructions that are both incomplete and also pretty stupid, as far as I’m concerned. After fiddling around with it for a couple of hours yesterday, I’ve concluded that there is no reason to include their sample project as a git submodule of your project. The instructions I’m going to suggest basically don’t do that, so if you are ultra concerned with keeping up to date with the ChimpKit project (keep in mind it hasn’t been updated since 9 months ago), then read-no-further, and go figure out how to actually use the classes in their sample project yourself (since that’s what’s missing from their instructions). Personally, I think git submodules are a PITA, and not worth the effort anyway.

OK, so what you really want to do is the following:

1) Download the ChimpKit code. You can clone it on github, or just download, your preference.

2) ChimpKit requires SBJson, so you’ll need to include that project’s files in your project. You can do this as a git submodule if you really want, but you already know how I feel about those. You can also just add the files to your project and be done with it.

3) Grab just the files in ChimpKit’s “Core” folder and drag them into your project (or use the “Add files…” dialogue). Personally, I like to organize code in my projects in a certain way, so I copied the directory into my project’s “Externals” directory, and renamed it from “Core” to “ChimpKit”.

4) If you don’t care about adding your subscriber to a group, you just need to do the following:

4.a) Add the include: #import "SubscribeAlertView.h" to the top of your view controller or wherever.

4.b) Add this code somewhere, maybe after an IBAction or something.

    SubscribeAlertView *alert = [[SubscribeAlertView alloc]
								 initWithTitle:@"Newsletter Sign-up" 
								 message:@"To sign up for the newsletter please input your email address below." 
                                 apiKey:mailChimpAPIKey_
                                 listId:mailChimpListID_
                                 cancelButtonTitle:@"Cancel"
                                 subscribeButtonTitle:@"Confirm"];
    [alert show];

Of course you’ll need to define mailChimpAPIKey_ and mailChimpListID_, but both are strings. If you don’t know your list ID, you can find that on the mailchimp website. (Or by using the “lists” api method, and you can see an example of that below.)

…and you’re done!

5) But assuming you care about adding your subscribers to the group, there are two ways you could go. You could modify the code in SubscribeAlertView, or implement the subscribe form yourself. I’m going to assume the former, and not go into the latter, even though it’s what I’m probably going to do since I think their popup looks like toasted a$$.

6) Next we’re going to find your list’s groups. You might be able to skip this step if you already know the name of your grouping and groups, because the API also supports adding by name, but I think this is a better way because a) you can use the ID, and b) you are sure to use the right strings, because you’ll be copy/pasting them out of the JSON. I actually had to perform this step because I’m not the MailChimp admin, I just have access to an API key.

6.a) First, set up the object you’re going to be calling this code from as a <ChimpKitDelegate> in your header, and #import "ChimpKit.h" in the source file.

6.b) Then implement the chimpkit delegate methods:

#pragma mark - chimpkit delegate methods

- (void)ckRequestSucceeded:(ChimpKit *)ckRequest {
    NSLog(@"HTTP Status Code: %d", [ckRequest responseStatusCode]);
    NSLog(@"Response String: %@", [ckRequest responseString]);
}

- (void)ckRequestFailed:(NSError *)error {
    NSLog(@"Response Error: %@", error);
}

6.c) Finally, you’ll need to run the following code to call the MailChimp’s ‘listInterestGroupings‘ API method. Again, you’ll need to define mailChimpListID_. (I just ran this in a ViewController’s viewDidLoad method.)

	ChimpKit *ck = [[ChimpKit alloc] initWithDelegate:self 
											 andApiKey:mailChimpAPIKey_];

	// get the lists
	// [ck callApiMethod:@"lists" withParams:nil];

	// get the list groups
	NSMutableDictionary *params = [NSMutableDictionary dictionary];
	[params setValue:mailChimpListID_ forKey:@"id"];
	[ck callApiMethod:@"listInterestGroupings" withParams:params];

(There’s your example in there of how to get the lists.)

With any luck, you’ll get a response that is a big block of JSON. Use your favorite online JSON parser to turn that into something readable, and it’ll probably look something like this:

[
  {
    "id":9501,
    "name":"Web Signups",
    "form_field":"hidden",
    "display_order":"0",
    "groups":[
    {
      "bit":"1",
      "name":"likes chess",
      "display_order":"1",
      "subscribers":0
    },
    {
       "bit":"2",
       "name":"likes go",
       "display_order":"2",
       "subscribers":0
    },
    {
       "bit":"4",
       "name":"likes puzzle games",
       "display_order":"3",
       "subscribers":0
    }]
  }
]

7) Add your group subscriptions by modifying SubscribeAlertView.m around line 140 to look like the following:

		NSMutableDictionary *params = [NSMutableDictionary dictionary];
		[params setValue:self.listId forKey:@"id"];
		[params setValue:self.textField.text forKey:@"email_address"];
		[params setValue:@"true" forKey:@"double_optin"];
		[params setValue:@"true" forKey:@"update_existing"];
		NSMutableDictionary *mergeVars = [NSMutableDictionary dictionary];
		[mergeVars setValue:
		 [NSArray arrayWithObjects:
		  [NSDictionary dictionaryWithObjectsAndKeys:
		   @"9501", @"id",
		   @"likes go, likes puzzle games", @"groups",
		   nil],
		  nil]
					 forKey:@"GROUPINGS"];
		[params setValue:mergeVars forKey:@"merge_vars"];
		[self.chimpKit callApiMethod:@"listSubscribe" withParams:params];

You’ll also note that double_optin was set to false by default. That’s a stupid default, IMHO.

So there you have it. I think you could probably replace the @"9501", @"id" key/value pair with @"Web Signups", @"name", according to the API docs, but I only tried the ID. I also added some code to the SubscribeAlertView‘s requestCompleted:(ChimpKit *)request method to actually let me know that the submission was successful, but other than that, I think I’ve outlined everything pretty well. Let me know if you find this useful.

Oh, and so life happens and it’s July and Oppo-Citrus isn’t out yet. It’s still “right around the corner”, but as you can see I’ve started this exciting (no really!) freelance project. I was definitely hoping this would happen when I set out on my own, and it’s been going great! It’s 20 hours a week of my time, and it turns out that’s actually more than half my time as an indie. (I don’t think it’s because I’m not working 40 hours either, I think there are just hours you end up “losing” to email or twitter or whatever.) Anyway, last week was a holiday week (the boss gave me two days off!), and I’m planning on slacking some this week too, so I haven’t worked on Oppo-Citrus as much as I’ve wanted. The next goal is to get it at least submitted to apple before I leave for vacation the last week of this month. We shall see. We shall see.

App Store Submission Process using Unity or UDK

Tuesday, May 8th, 2012

I responded to a mobile twin cities thread about developing for iPhone without owning a Mac with the assertion that you still needed a mac to submit to the app store with either Unity or the Unreal Development Kit. It bugged me that I hadn’t verified the information, so a couple of quick google searches later, and I confirmed that I had been correct. Both the unity submission process and submission process for the UDK require an apple machine at some point for code signing.

Code for my iPhone Game Programming Talk

Sunday, May 15th, 2011

When I did the talk last week on iPhone Game Development, I showed some code at the end of the talk written using the Cocos2D framework. In both talks, the tetris portion of the demo was almost (but not quite) finished. I promised I’d post the code on github when it was finished, so here it is, my intro to iPhone Game Development sample project on github.

Tetris is playable, but this code is barely working, to be honest. I haven’t played with it on a device yet, and I know there are cases in the rotatePiece method that haven’t been tested. I’ve got the next piece in the game model, but not showing up in the view. I was going to use Sneaky Input for the controls, but I ended up scrapping it and just using some really simple touch-based control instead.

Someday (hopefully soon-ish), I’ll be writing a blog post titled “how to write tetris in Objective-C using Cocos2D”. I’ll try and clean it up a bit then.

Introduction to iPhone Game Development

Wednesday, May 11th, 2011

I had the pleasure last week of presenting this talk twice, first for the local meetup.com iPhone developer group, and a second time the following Saturday at MinneBar. Here are the slides from the event, embedded for your pleasure:

For the talk, John Hibshire and I also created a spreadsheet listing all the iPhone game frameworks, libraries and SDKs we could find. I’m going to try and keep this data up-to-date, and add any additional projects as I find out about them.

I think my session was recorded, possibly by folks at the Uptake, but I have no idea if that recording is online (as a few others from the event are). If it was, I’ll definitely update this post to link to it, since these slides are pretty useless without my running commentary. There are some nice links in a “Resources” section in the last few slides, so you can enjoy those if nothing else.

UPDATE: I just posted a link to the sample code for this talk on github in a new blog post. The code shows various examples of how to do really basic things in Cocos2D, including using the schedule method to create a game loop, using the CCMenu class, drawing various particle types, and finally, how to write tetris in Objective-C using a Cocos2D texture atlas for the different piece types.