Skip to content
lhunath edited this page Sep 13, 2010 · 10 revisions

iLibs – Cocos2D-iPhone Companion Library

This is a companion library for iPhone OS game development using the Cocos2D-iPhone framework.

Cocos2D-iPhone

There are a few game development frameworks for the iPhone OS, and developers can also just use OpenGL/ES and the other low-level APIs directly.

Cocos2D-iPhone is the library I have chosen because it is very much alive, has a strong and growing community and provides in most all needs of basic and more advanced game development with a healthy and usable API.

Status

iLibs is being actively developed as it provides the basis for the games I write.

It was born from extracting generic components out of the Gorillas codebase and is currently mostly being used by Deblock. It is not a feature-complete library that provides in all your needs but does its best to be extensible.

I consider iLibs to be in an alpha stage. The API is not mature but is fit enough to be used for game development.

Features

Currently, the library is undergoing a feature push as new features are added on a weekly basis. The API should not be considered stable but is fairly reliable.

  • Cocos2D Actions: Modify arbitrary properties in combination with other cocos2d-iphone Actions such as Ease actions.
  • Abstract Application Delegate: Takes care of cocos2d-iphone and iLibs initialization.
  • Configuration: A configuration singleton provides dead-easy NSUserDefaults-backed strongly typed property-based configuration.
  • Audio: Configuration-based music manager and dead-easy sound effect management.
  • Logging: Support for logging at debug, info, warning and error level with a clean API.
  • Cryptography Utilities: Hashing, Encrypting and Decrypting.
  • Cocos2D Layers: Animating loading/aiming bar, Node scrolling (such as UIScrollLayer), flicking and swiping, Automatic Menu/Configuration menu generation.

Screenshots

These shots demonstrate iLibs features in the Deblock game.

Menu

Menus are built through a simple API. You mention the title strings, the callback to invoke when the user taps the menu item, and the item layout on screen. You can even specify a logo.

bc..
self.pausedMenu = [MenuLayer menuWithDelegate:self logo:[MenuItemImage itemFromNormalImage:"title.game.paused.png" selectedImage:“title.game.paused.png”]
items:
[MenuItemFont itemFromString:l("menu.level.restart") target:self selector:selector(levelRedo:)],
[MenuItemSpacer spacerSmall],
[MenuItemFont itemFromString:l("menu.main") target:self selector:selector(stopGame:)],
[MenuItemFont itemFromString:l("menu.game.end") target:self selector:selector(endGame:)],
nil];
p.

Configuration Menu

This menu is built from a given set of properties defined in the Configuration backend.

bc..
self.configMenu = [ConfigMenuLayer menuWithDelegate:self logo:nil
settings:
@selector(music),
@selector(soundFx),
@selector(compete),
nil];
p.

Scroll Layer

The following score list is built using a ScrollLayer. This allows the user to scroll through the list as though it’s a normal UIScrollView in a very intuitive way with the same fluent feel.

Flick Layer

This allows users to flick through a set of layers much the same way as the Scroll Layer works (it extends the Scroll Layer).

Clone this wiki locally