Giter Site home page Giter Site logo

menulevel's Introduction

MENULEVEL

A fine Cocos2d example to create a menu level in Angry Birds style. Requires only the inclusion of two files class and the images that you choose for your layers (already included in the example).

Is really very simple to add to your game, with few lines of code, and one objective-c class, you create a wonderful menu to choose the level of play. In this version there is a detailed example of how to use, but just use these simple commands, listed below, to get full functionality :

example:

#import "MenuLevel.h"

@interface YourLayer : CCLayer <MenuLevelDelegate>
{
}

// on init
CGSize size = [[CCDirector sharedDirector] winSize];	

MenuLevel *menu = [[MenuLevel alloc] init];
menu.delegate = self;
[self addChild:menu];

// 4 level buttons
CGFloat x = 100;
[menu createMenuItemLevel:1 position:ccp(x, size.height / 2) life:5 locked:NO];
[menu createMenuItemLevel:2 position:ccp(x + 70, size.height / 2) life:2 locked:NO];
[menu createMenuItemLevel:3 position:ccp(x + 140, size.height / 2) life:0 locked:YES];
[menu createMenuItemLevel:4 position:ccp(x + 210, size.height / 2) life:0 locked:YES];

// MenuLevel Delegate
- (void)menuLevel:(MenuLevel *)menuLevel buttonSelected:(id)source
{
	CCMenuItem *item = (CCMenuItem*)source;
	NSInteger buttonLevel = item.tag;
	...
	...
}	

sample screen-shot :

Screenshot

Prioregroup.com Home Page

menulevel's People

Contributors

priore avatar

Watchers

James Cloos avatar Nonconforme avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.