Permalink
Browse files

first commit

  • Loading branch information...
ricardoquesada committed Apr 5, 2012
1 parent 6ff86cc commit 783c2ca19fa9c5e2ec93b4008321afbd6860b1bb
View
@@ -0,0 +1,2 @@
+*.pbxproj binary -merge
+
View
@@ -0,0 +1,45 @@
+# git ignore template from: http://cocoaheads.tumblr.com/post/1350304132/gitignore-template-for-xcode3-4
+# cocos2d specific
+PLBlocks.framework/*
+*.pyc
+
+# old school
+.svn
+
+# osx noise
+.DS_store
+.DS_Store
+profile
+
+# Mac OS X Finder
+.DS_Store
+# Sparkle distribution Private Key (Don’t check me in!)
+dsa_priv.pem
+# XCode (and ancestors) per-user config (very noisy, and not relevant)
+*.mode1
+*.mode1v3
+*.mode2v3
+*.perspective
+*.perspectivev3
+*.pbxuser
+# Xcode 4
+xcuserdata/
+project.xcworkspace/
+# Generated files
+VersionX-revision.h
+# build products
+build/
+*.[oa]
+# Other source repository archive directories (protects when importing)
+.hg
+.svn
+CVS
+# automatic backup files
+*~.nib
+*.swp
+*~
+*(Autosaved).rtfd/
+Backup[ ]of[ ]*.pages/
+Backup[ ]of[ ]*.key/
+Backup[ ]of[ ]*.numbers/
+

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -7,13 +7,11 @@
//
-#import <GameKit/GameKit.h>
-
// When you import this file, you import all the cocos2d classes
#import "cocos2d.h"
// HelloWorldLayer
-@interface HelloWorldLayer : CCLayer <GKAchievementViewControllerDelegate, GKLeaderboardViewControllerDelegate>
+@interface HelloWorldLayer : CCLayer
{
}
@@ -40,65 +40,18 @@ -(id) init
// always call "super" init
// Apple recommends to re-assign "self" with the "super's" return value
if( (self=[super init])) {
-
- // create and initialize a Label
- CCLabelTTF *label = [CCLabelTTF labelWithString:@"Hello World" fontName:@"Marker Felt" fontSize:64];
- // ask director the the window size
- CGSize size = [[CCDirector sharedDirector] winSize];
+ CGSize s = [[CCDirector sharedDirector] winSize];
- // position the label on the center of the screen
- label.position = ccp( size.width /2 , size.height/2 );
-
- // add the label as a child to this Layer
- [self addChild: label];
-
-
-
- //
- // Leaderboards and Achievements
- //
-
- // Default font size will be 28 points.
- [CCMenuItemFont setFontSize:28];
-
- // Achievement Menu Item using blocks
- CCMenuItem *itemAchievement = [CCMenuItemFont itemWithString:@"Achievements" block:^(id sender) {
-
-
- GKAchievementViewController *achivementViewController = [[GKAchievementViewController alloc] init];
- achivementViewController.achievementDelegate = self;
-
- AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
-
- [[app navController] presentModalViewController:achivementViewController animated:YES];
-
- [achivementViewController release];
- }
- ];
+// CCSprite *sprite = [CCSprite spriteWithFile:@"texture2048x2048_rgba8888.pvr"];
+ CCSprite *sprite = [CCSprite spriteWithFile:@"texture2048x2048_rgba4444.pvr"];
+// CCSprite *sprite = [CCSprite spriteWithFile:@"texture2048x2048_rgb888.pvr"];
+// CCSprite *sprite = [CCSprite spriteWithFile:@"texture2047x2047_rgba8888.pvr"];
- // Leaderboard Menu Item using blocks
- CCMenuItem *itemLeaderboard = [CCMenuItemFont itemWithString:@"Leaderboard" block:^(id sender) {
-
-
- GKLeaderboardViewController *leaderboardViewController = [[GKLeaderboardViewController alloc] init];
- leaderboardViewController.leaderboardDelegate = self;
-
- AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
-
- [[app navController] presentModalViewController:leaderboardViewController animated:YES];
-
- [leaderboardViewController release];
- }
- ];
-
- CCMenu *menu = [CCMenu menuWithItems:itemAchievement, itemLeaderboard, nil];
+ [sprite setPosition:ccp( s.width/2, s.height/2)];
+ [sprite setScale:0.25f];
- [menu alignItemsHorizontallyWithPadding:20];
- [menu setPosition:ccp( size.width/2, size.height/2 - 50)];
-
- // Add the menu to the layer
- [self addChild:menu];
+ [self addChild:sprite];
}
return self;
@@ -114,18 +67,4 @@ - (void) dealloc
// don't forget to call "super dealloc"
[super dealloc];
}
-
-#pragma mark GameKit delegate
-
--(void) achievementViewControllerDidFinish:(GKAchievementViewController *)viewController
-{
- AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
- [[app navController] dismissModalViewControllerAnimated:YES];
-}
-
--(void) leaderboardViewControllerDidFinish:(GKLeaderboardViewController *)viewController
-{
- AppController *app = (AppController*) [[UIApplication sharedApplication] delegate];
- [[app navController] dismissModalViewControllerAnimated:YES];
-}
@end
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit 783c2ca

Please sign in to comment.