einserver.de

Happy Holidays & a Happy New Year

Flickr: A closeup from the decoration of anfemas Christmas Party.

Amongst other things, these are my favorite milesstones for 2012.

What a wonderful year.

So long.

On NinetyNine

NinetyNine Poster

It's been less then a week since NinetyNine finally made it to the iTunes AppStore. Whew, what a journey. In the last post I promised to reveal some details on the creation process so …

… Here we go

The app started with a rough sketch made in Xcode using Storyboards by a drunk Sven in a late December night. (That's what he told me!) The concept was set, it was quite entertaining, but it was missing a proper design so Sven decided to call me a few days later and I started Sketch and updated his rough idea into the UI you see today.

Since our timeframe was limited – we wanted to make it to the store before the Christmas block – I jumped in and helped Sven with coding, too. It was quite a nice experience to go back to Xcode and Objective-C after quite a long time.

I really enjoy some of the newer features that were introduced in iOS 6, so I thought this post might be a good place to tell you about them.

The launch screen transition

Since this is a game and the UI itself is quite minimal, the first impression when you launch it had to be a special thing.

The new(ish) animation blocks available in UIView make it very easy to create a chain of directed animations which allows me to work pretty similar to a keyframe based animation tool.

[UIView animateWithDuration:(NSTimeInterval) animations:^(void)animations completion:(BOOL finished)completion]

The transition starts with a dark background, fades to the final color and then moves the logo up with a slight bounce before it lands in it's final place. This behavior is used for many animations in the game and makes the motions more interesting.

Thanks to the blocks it's also pretty simple to implement, just animate to the anticpating value in the first block and use a second block in the completion block of the first to animate to the final value shortly after.

The buttons

The buttons used in the menu and in the game itself started out as simple rectangles. We tried quite a few hover states and I started playing with the available transforms and soon we found a match with a simple set of 3D transforms. It was quite static and didn't feel right when you touched the wrong side of the button, so Sven suggested using the touch point on the button to adjust the transforms.

It turned out to be quite simple. I just added a simple UILongPressGestureRecognizer to the button and used it's action to map the point inside the view to rewlative coordinates and used those as a scaling factor for the x and y coordinates of a simple perspective transformation.

The next step was to add a slight gradient to the buttons. Since we wanted to add basic theming support, I had to generate the gradient colors from a base value. In Sketch, I just used a gradient from black to white with soft light and a low opacity.

Which was exactly what I wanted to use in code only to get me lost in finding a way to do it. In the end I found the formula for Soft Lighting on Wikipedia and implemented it myself.

If anyone cares, the code looks like this:

// a is the bottom value, b is the top value
// call this function for the r,g,b channels.

CGFloat calculateSoftlight(CGFloat a, CGFloat b) {
    // via http://en.wikipedia.org/wiki/Blend_modes#Soft_Light
    CGFloat f;
    if ( b <= 0.5 ) {
        f = a - (1 - 2 * b) * a * (1 - a);
    } else {
        CGFloat g;
        if (a <= 0.25) {
            g = ((16 * a - 12) * a + 4) * a;
        } else {
            g = sqrt(a);
        }
        f = a + (2 * b - 1) * (g - a);
    }
    return f;
}

Upcoming features

We had some plans which didn't make it into the first release. Some of them are already implemented and just missing a proper interface, others didn't feel right or still need some work.

The first update will most likely add color themes and maybe also some new additional game modes.

To support theming, every color in the game comes from a singleton class which stores them and allows us to chose from a different set of colors on the fly. For now this makes it easier for us to create new themes, but it also gives us the option to provide a theme editor inside the game, which is quite unlikely to happen in NinetyNine, but it's still a nice concept.

Source Code

To color the icons inside the app on the fly we used MGImageUtilities from Matt Gemmell, which inspired me to follow his steps and release some parts of the code to the public. This will not happen right now, as we still have to pick a proper license and discuss on the how and when, but it's likely to happen soon after the next update is available.

Even more Shameless self-promotion

I plan to talk about the game in German in the next episode of Bring it on, the podcast I started with Daniel.

So long.

NinetyNine – Coming Soon.

NinetyNine website Instagram screenshot

When Sven approached me with this great little idea for a rather simple yet entertaining iPhone game, I wasn't sure, but when I started playing his demo, I fell for it. Now I'm sitting here, waiting nerviously. My very first app is waiting for review in iTunes Connect. Sven had the idea, I did the design and we both wrote quite a few lines of code.

Maybe I'll write about the whole experience when our app is released, stay tuned. If you want to learn more follow us on Twitter or like us on Facebook. I even made a small teaser website.

So long.

Looking for the cursor icon files in Mac OS X

Recently I was looking for a nice hand cursor which I could use for a presentation. After staring at the Google results for something like a Phootoshop file, I realized that the perfect example was right there, just before I even clicked a link: Since it's last iteration, Apples OS X sports wonderful and perfectly scalable new vector-based cursors – which have to be on the system somewhere. Luckily they were not stored in a binary, but as files in this folder:

/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HiServices.framework/Versions/A/Resources/cursors

So next time you need a cursor to explain a client where he has to click, try those. They look familiar and they work just great.

So long.

An easy way to access your iCloud documents

Apple has a strange idea of cloud based storage. The biggest problem of the current way for accessing files in iCloud is that you have no other option but to open the same application you used to put stuff into iCloud to access it again. Which means, once you use Mail to put a PDF into iCloud, it is somehow lost in the virtual realms. At least that's what I thought. After a bit of searching I found the files hidden in a folder in my Library.

Since I hate digging to folders just to reach a folder I know, I decided to make a symbolic link to the folder into my home directory. You can do the same by entering the following command into Terminal.app:

ln -s ~/Library/Mobile\ Documents ~/iCloud

I hope this saves some trouble.

So long.

Flo bäckt. →

I like baking and I wanted to try Tumblr.
So far it's a fun and tasty side project.

So long.

Using the build-in Apache in Mac OS X for PHP and Virtual Hosts

A collection of all steps necessary to use the Apache server
that ships with Mac OS X for web development with PHP and virtual hosts.

This guide is split into five simple steps.

  1. Enabling PHP on Mac OS X
  2. Enabling .htaccess files
  3. Enabling Virtual Hosts
  4. Configure Virtual Hosts
  5. Control Apache

All good things must come to an end

The star spangled banner waving in the wind

While I'm typing this, Dominik is cooking his amazing peanut curry and baking naan, which will be the start for our celebrations for the 4th of July.

I finally managed to upload a few more pictures, though I still have to go through 4000 more, there are now two new albums on Flickr: First Weekend, First week & WWDC and Second Weekend.


Tomorrow will be our last day here in San Francisco. We've been here long enough that our appartment already feels like home and the trip to Las Vegas felt like a short vacation from our "regular place". I'm still looking forward to be back home again, mostly because the weather here is quite cold compared to Germany.

So long.

First Vacation Days

On Monday my girlfriend and my best friend finally joined us in our apartment. Now we are six people in our appartment and it's still very comfortable.

Yesterday we went to the farmers market at the ferry building and made our way to the infamous tourist place known as Pier 39. After a few sea lions, the Golden Gate bridge in the fog and a quick peak at Alcatraz we turned back to the city, got new cards for our phones (at&t turned out to be a way better choice than T-Mobile) and went home, where Daniel was waiting.

He took my girlfriend to the airport to rent a car (there was a chance that she would get cheaper rates with her business card which didn’t work out). They got an freakingly awesome Ford Mustang!

Today went to the Westfield-Mall (or Nordstrom? It's the same building.) and after a few ours of browsing I got myself a new sweater from Hollisters.

Back home, we prepared a BBQ, but since the other guys came home quite late and it already started to get colder again, we stayed inside. Kudos to Dominik for the perfect steaks!

So long.

Excellent.

Excellent.

For reasons.

So long.