Showing posts with label cocos2d. Show all posts
Showing posts with label cocos2d. Show all posts

Wednesday, April 1, 2015

Rename SpriteBuilder Project

So, unless it's easy to rename an existing (like for example a nice game starter package); it will be pretty un-helpful to publish said examples.

So... off I went to discover the steps involved in the renaming process and it boiled down to TWO major steps.

STEP ONE:
1: Copy and rename the .spritebuilder file (bundle).
2: Once duplicated, rename it - make sure you conform to the standard SpriteBuilder limitations (USE NO SPACES).


3: Right-click and choose "Show Package Contents" to open the bundle folder. Just rename the .ccbproj file.



4: Double-click the Xcode project to open Xcode and proceed to STEP TWO.
In our example we are going to rename "StarterGame.spritebuilder" to "AwesomeProject.spritebuilder".


STEP TWO:
1: Once open in Xcode, perform a normal rename via the "Name" field in the right column.




Afterwards I usually close and exit Xcode then open the new project in SpriteBuilder, publish and use the shortcut to open Xcode.

Enjoy
:)

Friday, June 21, 2013

Cocos2d with iAd bannerView

I finally got around to cleaning up my base code I've been using in nearly all my cocos2d apps. This will jump start your project to include an iAd banner (top or bottom, set by macro) along with a few other items.

Feel free to check it out.

Screenshot:


Download Project file HERE.

Wednesday, November 2, 2011

[Epic Fail] Search for Open Source RPG

So, search google.code or git or wherever and you will find:
lots and lots of good intentions and well wishing but I've yet to find one that is viable or even modifiable for iOS development (except the Arianne engine)

So with that said... I'm going to develop a Cocos2d based RPG engine(1), it will NOT be open source. You will however be able to purchase a license to develop your own RPG games.

More information and I'll be updating the LoH (Legends of Hylore) web site.

(1)Engine: will have the ability to read plists and provide actions based on configuration data.

Wednesday, March 9, 2011

Xcode 4 & Xcode 3 Work Fine Together

Edit: Very timely! didn't know Xcode 4 would be released today!

DO NOT INSTALL XCODE 4 in the default location!!!
If you do/did you will/have replaced your Xcode 3 installation.

Edit: sorry for shouting...

Wait, what? you already installed it and now you lost Xcode 3... ARG the humanity!!!! Okay all is not lost, take a quick look at this older post about selecting a different folder for Xcode to install into and run the Xcode installers a second time. I would remove the old folders first.

I am using the following folders:
Xcode 3 (including the new iOS 4.3 GM SDK) installed into -> /Xcode3 (was /Developer) (1)
Xcode 4 (includes the GM 2) installed into -> /Developer (was /Xcode4) (1)

(1) Update: I just switched today with the final releases of both Xcode 3.2.6 and Xcode 4. I want Xcode 4 to be the default so I'm installing it into /Developer. You can install whichever way you want, heck even in /Xcode4 and /Xcode3, that may be the easiest way to keep them separate. Just know that "/Developer" will always be set as the default folder, regardless of the Xcode version.

Install the Xcode's in whatever order you want. To set the "default" version (the one that opens when you double-click a project file), choose get info on a project file from Finder and then browse to and select the Xcode app you want to use and select the Always use this application" checkbox.


The /Xcode4 folder was leftover from the beta installs but there is no reason it won't run just fine in that folder. This allows you to, very quickly create say a nice shiny new cocos2d 0.99.5 or heck even a beta 1.0.0 app with Xcode 3 using the cocos2d templates (that still work in Xcode 3) and then open the project in Xcode 4.

Sweeeeet.... :-]

Wednesday, January 19, 2011

Community Game Project

We are participating in a Community game project. We had a delayed start but the project has been underway for almost a week and so far it's very cool. Indeed a great experience, especially for someone that has never developed in a team environment.

You can find out more about the project here:
http://www.iPhoneGameKit.com/community/

Wednesday, October 6, 2010

Taking Advantage of the RootViewController

that is now available in cocos2d 0.99.5

I mentioned in a forum post about how cool it is not that we have an actual view controller available to us to hang stuff off of. A few people have asked about what I was referring to, so here's a sample project.

This is just the cocos2d base template with the MessageUI framework added (required for in-app email) and a few bits of code.

First we'll add a menu to "Hello World", add this in the layer init;

CCMenuItem *emailItem = [CCMenuItemFont itemFromString: @"Email" target:self selector:@selector(emailCallback)];
CCMenu *menu = [CCMenu menuWithItems: emailItem, nil];
menu.position = ccp(50,50);
[self addChild:menu];


Now add the emailCallback method;

-(void) emailCallback
{
    [(BaseEmailAppDelegate*)[[UIApplication sharedApplication] delegate] sendEmail];
}

In our app delegate we need to create our sendEmail method;
In the .h file

-(void)sendEmail;

In the .m file

-(void)sendEmail
{
    [viewController displayComposer];  
}

In our RootViewController we need to create our displayComposer method;
In the .h file
Import the MessageUI header

#import <MessageUI/MessageUI.h>
and add MFMailComposeViewControllerDelegate
@interface RootViewController : UIViewController <MFMailComposeViewControllerDelegate> 
{
}

-(void)displayComposer;
@end

In the .m file

@implementation RootViewController


#pragma mark -
#pragma mark Setup Mail Alert
- (void)setUpMailAccount {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"System Error"
message:@"Please setup a mail account first."
delegate:self 
cancelButtonTitle:@"Dismiss"
otherButtonTitles:nil];
[alert show];
[alert release];
}

#pragma mark -
#pragma mark Compose Mail
// Displays an email composition interface inside the application. Populates all the Mail fields. 
-(void)displayComposerSheet {
if(![MFMailComposeViewController canSendMail]) {
[self setUpMailAccount];
return;
}
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;

[self presentModalViewController:picker animated:YES];
    [picker release];
}

-(void)displayComposer {
NSLog(@"pop-up email here");
[self displayComposerSheet];
}

// Dismisses the email composition interface when users tap Cancel or Send. Proceeds to update the message field with the result of the operation.
- (void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
// Notifies users about errors associated with the interface
switch (result)
{
case MFMailComposeResultCancelled:
break;
case MFMailComposeResultSaved:
break;
case MFMailComposeResultSent:
break;
case MFMailComposeResultFailed:
break;
default:
{
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Email" message:@"Sending Failed - Unknown Error :-("
delegate:self cancelButtonTitle:@"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
}
break;
}
[self dismissModalViewControllerAnimated:YES];
}

Here is the LINK to the sample project.