Posts Tagged ‘Animation’

I updated SpaceBubble to support iAds a while ago but haven’t gotten around to uploading the new code. This is good, because I found a bug in the meantime. This is for the unreleased version which is still in review with all bugs fixed. Enjoy!




Here is the updated Objective-C source code to my iPhone game SpaceBubble! (more…)

Let’s say you have a view overlaying another view that you would like to close in a fancy fashion when the user click a button, thus displaying the view directly below it. Put this code as your button’s IBAction message handler and tell me that doesn’t spice up your app like crazy! I am not going to explain how it looks, just try it. You’ll love it. It’s a nice use of code blocks too. :)

-(IBAction)onButtonClick:(id)sender {
	[UIView transitionWithView:self.view duration:0.2 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{
		self.view.frame = CGRectOffset(self.view.frame, 0, -self.view.frame.size.height);
	} completion:^(BOOL finished) {
		[self.view removeFromSuperview];
		[self release];
	}];
}

The learning curve of Cocoa can be steep depending on your background, but it’s a climb that is sure to leave a smile on your face every few steps of the way. Just enough to offset the hair pulling and cursing that is sure to ensue from jumping into Cocoa programming for the first time. One of the features that sweetened things up for me was Cocoa’s UIView animation capabilities. There is a lot to cover, and I just don’t have the time to even think about how to approach a lesson on all the animation features. I will give you an example of basic animation and a possible implementation and point you in the direction of Apple’s documentation so that you can build upon what you learned here.

For more information make sure to read Apple’s documentation on the UIView class. There is a lot more you can do with but let this be simply a foundation for you to learn the basic concept.


(more…)

I updated SpaceBubble to support the retina display on the iPhone 4. It was quite simple really, just had to change a few lines of code, rebuild my Entitlements.plist file, and add high resolution images.




Here is the updated Objective-C source code to my iPhone game SpaceBubble! (more…)

I am releasing the Objective-C source code to my iPhone game SpaceBubble to the public! It is released under the “Take a kid fishing or hunting license” which means in order to use this code in your project you must take a kid fishing or hunting, and give credit and a link back to the author (me) in some way or another such as on your product web page, about box, or legal agreement.

I hope this helps you take the leap into iPhone game development. Enjoy!

Download:
SpaceBubble Source Code – 938k

Here is some simple code to setup an animated sprite using a UIImageView. I used this in my game SpaceBubble and although it should be pretty self explanatory, I commented the code as heavily as I possibly could. This uses a class called Sprite that inherits from UIImageView. The only thing changed from a standard UIImageView is that there are values you can store in the sprite such as point values for coins in a game. setupAnimatedSprite really simplifies the process of creating animated sprites using UIImageViews. So simple in fact you can do it with one line of code! Enjoy! Feedback much appreciated.

(more…)

Twitter Me