Lumi v1.5 with solution sharing…

0

The latest version of Lumi (and Lumi HD) has been released on the AppStore.
The most exciting part of this release is that I have finally provided players with the ability to share their solutions with others.

The solutions are submitted to the Lumi web portal located at http://lumi.icarus7.net and the solution are viewable under the (more…)

Since Lumi…

1

It has been almost 3 months since Lumi released, and I’ve found myself in a bit of a hole with regards to prototyping new ideas and just generally writing new code.

Has this ever happened to you, where after coming off a highly motivating project, you suddenly lose motivation to do anything new apart from maintaining the now-released app-o’-awesomeness?
If yes, what did you do (if anything) to get yourself to start creating again?

cocos2d-iphone: A Binary Clock

0

Here is a CCScene based Binary Clock implementation in cocos2d-iphone. I used 0.99.5 for this, but it should compile flawlessly on 0.99.4 as well…

ClockScene.h

//
//  ClockScene.h
//  BinaryClock
//
//  Created by Peter Mares on 23/02/2011.
//  Copyright 2011. All rights reserved.
//


// When you import this file, you import all the cocos2d classes
#import "cocos2d.h"

// HelloWorld Layer
@interface ClockScene : CCScene
{
	CCLabelTTF *_arrLabels[6];
}

+(id) scene;

@end

ClockScene.m

//
//  ClockScene.m
//  BinaryClock
//
//  Created by Peter Mares on 23/02/2011.
//  Copyright 2011. All rights reserved.
//

// Import the interfaces
#import "ClockScene.h"

////////////////////////////////////////////////////////////////////////////////////////////////

@interface ClockScene ()
- (void) onTick:(ccTime)dt;
- (void) updateClockDisplay;
@end

////////////////////////////////////////////////////////////////////////////////////////////////

// HelloWorld implementation
@implementation ClockScene

+(id) scene
{
	ClockScene *scene = [ClockScene node];
	return scene;
}

////////////////////////////////////////////////////////////////////////////////////////////////

-(id) init
{
	if( (self=[super init] )) 
	{
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		CCLabelTTF *label = nil;
		float yOffset = 0;
		
		for ( int i = 0; i < 6; i++ )
		{
			yOffset = (i % 2) * 25;
			label = [CCLabelTTF labelWithString:@"0000" fontName:@"Helvetica-Bold" fontSize:16];
			// some arbitrary magic numbers to make it work - you can make this more dynamic...
			label.position = ccp( winSize.width / 2 - ( (1-(i/2)) * 100 ), winSize.height / 2 - yOffset);
			[label setColor:ccc3(255, 255, 255)];
			_arrLabels[i] = label;
			
			[self addChild:label];
		}
		
		[self updateClockDisplay];
		[self schedule:@selector(onTick:) interval:1];
	}
	return self;
}

////////////////////////////////////////////////////////////////////////////////////////////////

- (void) dealloc
{
	[super dealloc];
}

////////////////////////////////////////////////////////////////////////////////////////////////

- (void) onTick:(ccTime)dt
{
	[self updateClockDisplay];
}

////////////////////////////////////////////////////////////////////////////////////////////////

- (void) updateClockDisplay
{
	NSDate *now = [NSDate date];
	NSCalendar *calendar = [NSCalendar currentCalendar];
	NSDateComponents *components = [calendar components:NSHourCalendarUnit|NSMinuteCalendarUnit|NSSecondCalendarUnit fromDate:now];
	int timeComponents[6];

	// now transform the hours, minutes and seconds into binary nibbles
	timeComponents[0] = [components hour] / 10;
	timeComponents[1] = [components hour] % 10;
	timeComponents[2] = [components minute] / 10;
	timeComponents[3] = [components minute] % 10;
	timeComponents[4] = [components second] / 10;
	timeComponents[5] = [components second] % 10;
	
	// translate each component into a binary nibble string
	for (int i = 0; i < 6; i++ )
	{
		NSMutableString* str = [NSMutableString string];
		
		for ( int bit = 8; bit > 0; bit >>= 1 )
			timeComponents[i] & bit ? [str appendString:@"1"] : [str appendString:@"0"];
			
		[_arrLabels[i] setString:str];
	}
}

@end

cocos2d-iphone: Sliding menu (from Lumi)

15

When Lumi was being designed, I wanted to make the navigation through the level packs and levels as slick as possible. I had played enough iOS games to know that navigation makes a huge difference to a games impact on a player. We were aiming for a simple, almost obvious paradigm to allow players to navigate through the level packs and levels.
I realised that during the discussions, the word ‘pages’ was constantly mentioned, as in ‘when the player goes from this page to this page’ or ‘maybe we should let the player flip through pages of levels’… this was so obvious – we were even using it while discussing WHAT the navigation would be. So, pages it was. With that out of the way, I decided to go with a UI mechanism similar to what Angry Birds had done for their level selection mechanics, which was to allow the user to slide left/right to flip ‘pages’.

Initially I had the code doing the same thing (sliding left and right), and that worked really well, but after I saw the graphic assets and we discussed how the level pack graphics would look, I realised I had to move to an up/down sliding mechanism. Not a problem, a quick refactor, a new enumeration and voila!

So now that Lumi has been released, and is doing well, I thought I’d share the code behind Lumi’s sliding menu system.

WARNING! LOTS OF CODE COMING NOW…

(more…)

Lumi and Lumi HD have been approved and released on the App Store!

0

I’m extremely proud and happy to announce that our second game, Lumi, has been released for both iPhone and iPad this evening.

You can grab your free copy at the following links:

Lumi
Lumi HD

Lumi and Lumi HD have gone into review!!

2

I’m excited, and at the same time nervous. This is the first app I’ve done with StoreKit integration, and I just can’t shake the feeling that something, somewhere, is going to go wrong…

Oh well, the worst that can happen is a rejection. Lets hope it doesn’t happen :)

Lumi Teaser Video

0

Here is a teaser video of the new Lumi game….

Lumi: The starting screen

Lumi submitted to App Store

0

I am proud to announce that at 22:51 on the 31st of December, 2010, our latest game, Lumi, has been submitted to the App Store for review (and hopefully approval *nudge nudge @ Apple* :)

As a taster, here are some screenshots of this up and coming puzzler…

Lumi: The starting screen

The game is a puzzler where you take control of light beams and direct, reflect and filter them in order to get them to hit their targets…

Lumi: An intermediate level starting out

Most puzzles have more than one solution… and some cool particle effects when you get a light beam to hit the correct target….

Lumi: A solution in action...

As soon as I hear from Apple (approval or rejection), I’ll update.

Might also post a video of the game in action once its done….

Happy New Year everyone!!!

cocos2d_logo

cocos2d-iphone: A basic button class

7

cocos2d-iphone is an amazing 2D OpenGL development framework, and comes bundled with a ton of really great and useful classes that make game development a pleasure. However, one of the things that it is currently missing is a basic button object that can be used freely in your projects.

I’ve created a class called BasicButton class that uses delegates and selectors to quickly create buttons and react to them in a seperate ‘handler’ object.
(more…)

cocos2d_logo

cocos2d-iphone: Filled polygons

2

While testing my upcoming game on an iPhone 3G, I discovered that drawing line segments was error prone in terms of accurately connecting multiple line segments seamlessly. The problem seems to arise from the fact that OpenGL cannot guarantee exact pixelation for lines (using glDrawArrays(GL_LINES…) ).

This is mentioned in the Rasterization FAQ on the OpenGL site here : Link
(more…)

Go to Top