Code for my iPhone Game Programming Talk

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.

A new Tetris Documentary

Details on a new Tetris documentary called Ecstasy of Order are emerging. It is, according to the website, “a feature length documentary set for release in 2012 that captures the greatest world record Tetris players as they prepare for the Classic Tetris World Championship”. (Via Zack, who sent me this Joystiq post about it yesterday.)

This led me to wonder how many documentaries there have been about Tetris already. I thought I had viewed at least two of them, but some quick googling only comes up with Tetris: From Russia With Love, which was a BBC doc from 2004. It appears you can still watch it online. I particularly liked that one of the commenters on that site called it “a Web Filter Unit test”.

Table-top Tetris

The idea of Tetris as a physical board game is not a new idea. (I have a small collection of them.) While visiting Kotaku tonight, I found an intriguing post about two new Tetris board games showcased at the Toy Fair 2011 in New York City.

First I’ll mention Tetris Link, a stand-up version of Tetris for up to four players. The gameplay here is not about breaking lines. You get one color, (and presumably all the shapes), and you try and connect up your pieces while preventing your opponents from doing the same. I’m not exactly blown away by the originality here, although I suppose none of the other Tetris board games have been all that ground breaking either, but at least this could have had a hint of strategy in it, if they hadn’t introduced a die that you use to determine which piece you get to drop. I mean, sure, I’d buy it just for the die with Tetris shapes on it, but do I want to play a game with that mechanic in it? Not really. Fortunately, I’m sure it won’t be too hard to make up some slightly more thought-provoking rules about when you get to drop what pieces.

Tetris Link won’t be hitting stores until sometime later this year, and it sounds like it’ll be exclusive to B&N before it hits shelves everywhere. I don’t know if I’ll even remember to look for it at B&N, so it could be quite a while before I get this one. Also, I pilfered the photo above from Tetris Link’s facebook page, where it looks like they had some giant Tetris pieces to play with, as illustrated by these Tetris booth babes. (There were a lot more photos like that one on Facebook. Shameless, or fun? You decide.) You can also register to win a copy from the Facebook page (at least for the next day or two).

This is the one I feel is a MUST HAVE (although, lets be honest here, I’m obviously a collector, and I’ll be getting them both). The game, which may or may not be called simply “Tetris the Card Game“, is apparently getting made by Fundex, the same folks who made five billion versions of Phase 10. Apologies for the bad video still, but I simply wasn’t able to find out much of anything about this game! I can’t wait to get my hands on a copy, and the video says they’re available now!!! Chances are that it’ll be in Target (based on the Phase 10 connection) and all over the place, but I’ll be damned if I can find it anywhere online tonight. When I get access to some actual product information, I’ll have to post it here (as well as at boardgamegeek, which is still unaware this product exists). This is appealing to me for a lot of reasons, but mainly because it looks kind of like a multiplayer puzzle mode for Tetris.

In my scouring the internet for the above card game, I eventually remembered to try the official Tetris site, where I’d forgotten they do occasionally post some pretty interesting Tetris related news items. Some quick links to things I missed in the last year or so since I’d been on there:

Visit the Kotaku post for videos of both of the new board/card games in action.

Game Center Match-3 Mania!

Game Center games are starting to pour in, and today I stumbled onto the (true**) first Match-3 game I’d seen, (although I don’t think it was the first one on there), called GeoBlocks. I’m going to talk about that, and then I’ll also talk about the second match-3 game I played with Game Center integration, Squaree, and I will actually go so far as to say that Squaree is my new favorite Match-3 game! As of this writing, both GeoBlocks and Squaree are FREE in the app store, so get ’em while they’re hot.

I played GeoBlocks for quite a while, trying to get the next achievement. It’s a pretty standard match-3, with level progression based on the number of matches you’ve gotten in all the colors. In fact, that’s one of the only really interesting aspects of the game… to score really big, you actually want to try NOT to progress, so you can rack up points before the timer (white line at the bottom of the screen) gets going so fast that you don’t have time to think before you match.

I made a note to myself to add GeoBlocks to my spreadsheet listing Match-3 games for the iPhone, and I actually went one step further than that, and added a column indicating whether the game has Game Center integration. I suppose now that I’ve done that, I should really add another column for OpenFeint. Maybe I’ll do that some other time and actually go through all the games listed to see which have which features.

So then I went looking to see if there were other Match-3 games with Game Center, and I found Jewel Craft in the featured list. I wasn’t about to shell out $3 for another Match-3 game though, (especially when I just played a perfectly decent one for free). That got me thinking about what other free Game Center games there might be out there, so I searched App Shopper for “game center”, and sorted by price. That was when I found Squaree.

Squaree doesn’t really look like much, and (as is common when I go app shopping) at first I didn’t even play it, just downloaded it to check out later. But I soon grew tired of scanning through all the crap in that AppShopper search, and Squaree was either the first or second app I opened up to check out.

It’s match-3, definitely, but the way you get your squares is pretty unique. There is a board with a whole bunch of grayed out pieces. Tapping a piece causes un-gray, and for it to fall all the way to the bottom of the board (or until it hits another solid piece). Get three of the same color to match, and two of them disappear, but the third turns into a “locked” piece. Match four pieces and you get a X2 piece remaining, and if you match 5, you get a piece that, when matched, removes all solid pieces of that color from the gameboard.

This is pretty much all you need to know to get started playing Squaree. It’s simple, yes, but I had a lot of fun with it, and I’ll definitely be playing more of it in the next few days. There are two game modes, but only the “Challenge” mode has a high score list. That list is extremely short right now, and I’m hoping to make it to the top with some practice in the next few days. My only disappointment was finding out that there aren’t any Achievements. I wish I could add yet to the end of that statement. :)

**Note that both Azkend and Dice Match had Game Center the day after its launch. They are both solidly in the Match-3 category, but neither has the swap-to-remove mechanic. Both are the kind where the matches already exist and you have to choose which one to remove. (Think Same Game rather than Bejeweled, but you have to touch all the pieces you want to remove.) It would be interesting to write another post comparing and contrasting those two games, but I’m pretty much done for the evening.

Master of Tetris

Here is a screenshot of an intriguing new tetris-variant in the app store, Master of Blocks, by Tuomas Pelkonen. I’ve had a chance to try it out, and you don’t get complete cart blanch to drop any old blocks willy-nilly, you basically have to pick from the blocks available, and once you’ve chosen one, you can’t pick that one again until all the others have been chosen. There is also a button to delete a single square that has already been placed.

Probably the most interesting feature of this game is that it supports bluetooth multiplayer, so you can play a head-to-head mode where you choose the blocks for your opponent while they play Tetris, and then they choose the blocks for you. I was confused at first because I didn’t know it was going to switch, and we both had the same score. It might have been hard to balance, but I could have imagined you both getting points for different things while you play that mode, so you didn’t have to play two rounds to figure out who won. My wife and I actually played cooperatively for a while, which was more fun than it probably sounds like it would be. Again, because you can’t give them just whatever pieces you feel like, there is some strategy involved, and furthermore, using the delete-a-square button for good rather than evil was almost as satisfying.

I imagine the game to have been inspired by the College Humor video The Tetris God (which if you haven’t seen it is well worth the watch), in which a merciless god controls the falling of Tetris blocks.

Random tetris linkdump:

  • There was a 4-story tall Tetris game set up at burning man back in 2008. I wish I’d been there to see it, and wonder where it ended up after the event.
  • This screenshot someone took of a tiny tetris called Tetoris (via offworld) is pretty enough that if it were larger I would consider making it my desktop. The game itself reminds me a bit of the slow pace of Sequoia Touch, which has given me renewed pleasure in 2x mode on my iPad.
  • It’s over a year old, but this Tetris bento box looks quite tasty.

HateTRIS

Hatetris is a Tetris variant that chooses the worst piece possible and makes you play it. (Via jttiki, but ultimately via BoingBoing.)

I have a lot of respect for the author, Sam Hughes, as he claims he wrote Hatetris in JavaScript because he feared and/or despised it. I also despise JavaScript, but not so much that I want to write Tetris in it. (And anyways, I already wrote Tetris in ActionScript, which sucks as bad or worse than JavaScript. Hughes’ code is much prettier than mine, I looked.)

Philosophical statements aside, Hateris actually succeeds as a game for several reasons. One is that, because the game is not random, getting even one more line than on a previous attempt requires you to try a different tactic, or approach the game with a different strategy. It’s clear that Hughes knows he’s onto something there, because he’s implemented the ability to replay previous games. It’s quite fascinating to watch the current record (22 lines), and analyze the tactics used.

Following various comment threads on Hatetris, I also discovered that there was previously a similar variant called Bastet (bastard tetris–desktop only), and also that there is not just one, but two playable versions of Randall Munroe’s vision of hell.

Update: One of the playable versions of hell links was broken, so it was removed on May 5th, 2017. Thanks to a reader for pointing that out!

Mobile Tetris tops 100 Million Downloads

A ridiculous number of news sources are reporting that EA and Blue Planet Software held a press conference a couple of days ago announcing that Tetris has reached the 100,000,000 paid downloads mark. EA’s iPhone Tetris has a near-permanent place on the app store’s list of “Top Grossing” apps, so it didn’t surprise me to hear that the iPhone port is doing well, but Tetris is apparently also available for 64 thousand other models of mobile device. I didn’t even know there were that many mobile devices out there!

Here’s the official press release over at Tetris.com, where they are also featuring (advertising) the iPhone app, as well as Tetris Gems — a site where you can buy officially licensed Tetris jewelry of all things. (I would definitely wear one of these rings, but I’m not entirely sure it’s worth the $329.00 asking price.)

While poking through Tetris related news articles, I read a wired article from last year about some study that found playing Tetris improves your brain. And tangentially related is a very fascinating article I read even earlier this evening by Garry Kasparov titled The Chess Master and the Computer. It’s mostly about the state of computer chess AI, but more interestingly how those programs are having an effect on human players.

Finally, did you know there is a Church of Tetris!? Neither did I.

Awesome and new-to-me Internet Tetris variants

First Person Tetris has clearly been making the rounds. (I’ve had three separate people tell me about it in the last week.) Basically, the whole screen rotates and moves while the current piece remains stationary in the center of the screen. I was actually surprised at how easy this was to play, intuitive even. Ultimately though, it’s still Tetris, with nothing terribly different about it, so it’s probably got a fairly limited replay value.

Tuper Tario Tros is tetris meets mario bros. You can also find it on Kongregate. From the developer’s description:

We were playing some Xbox Live games during lunchtime. Guillaume was really excited about “Lucidity” and the idea of playing a “Tetris platform” game… but he finally felt disapointed by the concept.

So, Guillaume decided to create a little Tetris plateformer for fun. William came with the idea to mix up Tetris with another well know game: Super Mario Bros.

This is interesting to me, because I also tried out (and was a tad bit disappointed with) the much hyped Lucidity. It’s definitely very pretty, but the gameplay just felt a bit lacking. Anyway, Tuper Tario Tros is a novel idea. You are basically just playing standard Mario Bros, but then a popup tells you you can switch into tetris mode by hitting the space bar. Then it’s up to you to build the 2d platforms for Mario to traverse using Tetris pieces. Eventually you reach the end of the level, and the gameplay switches to another mode entirely. Those folks at SwingSwing Submarine did a great job of creating not one but two new and interesting gameplay types out of it. The first part is relatively short, so I’d recommend sticking with it until you finish it so you see the second one. Good stuff.

3D Stereogram Tetris has probably been around the longest of these three. When I sent it out at work, one of my coworkers said she’d been playing it for years. It’s exactly like a Stereogram image, where you have to cross your eyes correctly to see the game, and I found out that gives me a headache after a very short amount of time. I only recently discovered this painful Tetris variant a few months back, and it deserves a place on any list of Tetris variants, for novelty alone.

It bears mentioning that Wikipedia has a nice page listing many official Tetris Variants, (I may have linked to this before) but the page doesn’t seem to have any flash games on it, and is most useful when trying to remember which version of tetris existed for which console system. I briefly toyed with adding these, and possibly Go-Tetris to the page, but I think adding my game would be against Wikipedia’s TOS.

Tetris Linkdump / Tetris Tattoos

Been meaning to post a link to this waffle tetris image for a while now, and just hadn’t gotten around to it:
waffletetris

Then I just saw a geeky video game tattoo (on twitter, of course) it just occurred to me to search for tetris tattoos. I found a nice collection of them over at Geekologie, and ended up doing my own googling as well. Here are the ones I found not on that link:
tetrisTetris-tattoos-8266372-800-600 and TetrisTat

This is not news, but I watched this lego tetris vid for the first time tonight:

BoXiKoNOnPhoneI discovered this iPhone game BoXiKoN only just yesterday. I don’t think this one was out when I did my roundup of games that use tetris pieces before. The game description says it has been a successful PC game for years, but this is the first I’d heard/seen of it. It’s not limited to tetris pieces, but it’s a very solid action puzzle game nonetheless. I’m now following the dev’s twitter account.

Finally, there are some really great tetris webcomics over on Geek’s World. I didn’t discover these until late in my tetris tattoo searching, so I have no idea if there are other Tetris comics out there. I’ll put that on my todo.