December 2009
25 posts
3 tags
Sound Effect Generator
http://www.superflashbros.net/as3sfxr/
Dec 28th
1 note
3 tags
Artifice Multiplayer Ready For Beta Testing
Tonight I successfully implemented multiplayer in Artifice using OpenFeint challenges. I am pretty sure I am not using challenges the way they were intended. In the OpenFeint sense of things, all challenges are declined. The challenge system is simply used to pass the game data from player to player. This allows for the use of the push notifications system without actually ever using a challenge...
Dec 16th
3 tags
UITextField inside UIAlertView
UIAlertView *myAlertView = [[UIAlertView alloc] initWithTitle:@"Your title here!" message:@"this gets covered" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil]; UITextField *myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12.0, 45.0, 260.0, 25.0)]; [myTextField setBackgroundColor:[UIColor whiteColor]]; [myAlertView...
Dec 15th
2 tags
Agile and Scrum'd
ejdraper: I’ve been meaning to write this up for almost two weeks now, but there is no time like the present! A couple of weeks ago Robert Dempsey, CEO and founder of Atlantic Dominion Solutions took some time out of his busy schedule to speak to me about agile, and specifically agile from a freelancers point of view. We had a great chat and covered a number of different things, but it was...
Dec 14th
2 notes
3 tags
Multiple Account Support Added To Artifice
I just got done adding support for multiple OpenFeint accounts. Saved games will only show on your account. There will also be a “default” account to use if you have no internet initially to set up OpenFeint. The default account will only allow you to play another person with a shared device or against the computer. Ranks will also be included in the new version. Ranks will be earned...
Dec 12th
1 note
3 tags
iPhone SDK Set Title on UINavigationBar
uiNavigationBar.topItem.title = @"My Title";
Dec 11th
1 note
3 tags
iPhone SDK Static Class int
// MyClass.m #import "MyClass.h" @implementation MyClass - (id) init { self = [super init]; if (self) { [MyClass setCount:[MyClass getCount]+1]; } return self; } static int count = 0; + (int) getCount { return count; } + (void) setCount:(int) c { count = c; } @end
Dec 11th
3 tags
iPhone SDK 2-D Array
This class can be very useful for managing data for a tile based world. // TwoDMutableArray.h @interface TwoDMutableArray : NSObject { NSMutableArray *_array; int _width; int _height; } @property (nonatomic, retain) NSMutableArray *_array; - (id) initWithColumns:(int) cols andRows:(int) rows; - (id) getObjectAtColumn:(int) col andRow:(int) row; - (void) setObject:(id) obj...
Dec 11th
3 tags
iPhone SDK Static Class NSMutableArray
// In the MyClassWithStaticArray.h + (NSMutableArray *) myStaticNSMutableArray; // In the MyClassWithStaticArray.m static NSMutableArray * myStaticNSMutableArray = nil; +(NSMutableArray *) myStaticNSMutableArray { @synchronized(myStaticNSMutableArray) { if (myStaticNSMutableArray == nil) myStaticNSMutableArray = [[NSMutableArray alloc] init]; return...
Dec 11th
3 tags
iPhone SDK Random Number
Dec 11th
3 tags
iPhone SDK Convert NSData to NSString
Dec 11th
3 tags
Artifice AI On Hold
I decided to put the AI on hold temporarily. I have a very dumb AI in place now so it is functioning. I am going to focus my efforts towards the turn based multiplayer. I have some beta testers lined up and I hope to have it in there hands for initial testing next week. Tonight I got the select a friend feature done. You can now select a friend from your OpenFeint friends to challenge to a game. I...
Dec 11th
3 tags
Push Notifications Enabled
I have successfully implemented push notifications into Artifice. This will come in very handy when I setup the multiplayer functionality.
Dec 10th
3 tags
Game Play Complete
The game play functionality for Artifice is now complete. Next up is the task of creating a better AI opponent. I am much happier with the cleanliness of my code this time around. The first version of Artifice was built with very little knowledge of Objective C. Once the AI is complete I will begin to implement the online turn based multiplayer. Target submission date to the App Store is January...
Dec 10th
3 tags
Apple Bans Shady Developers
Fake reviews and mass submission of poor quality apps get almost 2000 apps pulled from the App Store. Review Faker | Poor Quality App Maker
Dec 8th
6 tags
OpenFeint Integrated Into Artifice
I finished the initial integration of OpenFeint in the new version of Artifice. This version of Artifice will be a complete rebuild with better AI and achievements. I am also adding an additional character and the ability to choose which character to use for each team. Along with being able to choose characters you will also be able to choose what board to play on. With this new system I hope to...
Dec 5th
3 tags
Code Sampled Restored
I just restored my most searched code samples thanks to cached pages from Google, and I spruced up the design a bit. Also thanks to some help from Elliott Draper I was able to set up some nice static pages utilizing “private” posts on tumblr. All my other static resources like CSS and Javascript are now hosted on Amazon Simple Storage Service (S3). I am really starting to like the...
Dec 5th
3 tags
iPhone SDK Save Application State
NSUserDefaults is your friend when you need to save a small amount of data. Here is some sample code for saving various data types. NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; //Setting defaults [defaults setInteger:1 forKey:@"myint"]; [defaults setObject:@"my string" forKey:@"mystring"]; [defaults setFloat:100.23 forKey:@"myfloat"]; //Getting defaults int myint =...
Dec 4th
3 tags
Dispatch and Receive Events iPhone SDK
This code sample shows how to dispatch and receive events in an iPhone application. You use the NSNotificationCenter to dispatch an event from within your application. Then where you want to receive the event you would add the object to receive the event as an observer to the NSNotificationCenter. //Dispatch and event [[NSNotificationCenter defaultCenter] postNotificationName:@"myevent"...
Dec 4th
1 note
3 tags
iPhone SDK Show Activity Indicator in the Status...
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES; [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
Dec 4th
3 tags
iPhone SDK dismiss the keyboard
Q: How do you remove the keyboard when the Return/Done button is pressed? A: Set the delegate on the text field that will bring up the keyboard. Add the following selector to the object that you set to be the delegate. - (BOOL) textFieldShouldReturn:(UITextField *) textField { [textField resignFirstResponder]; return YES; }
Dec 4th
1 note
3 tags
iPhone SDK Load Text File Into NSString
NSString *path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"txt"]; NSString *fileText = [NSString stringWithContentsOfFile:path];
Dec 4th
3 tags
iPhone SDK Plist to NSDictionary
NSString *mainBundlePath = [[NSBundle mainBundle] bundlePath]; NSString *plistPath = [mainBundlePath stringByAppendingPathComponent:@"myplist.plist"]; NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
Dec 4th
3 tags
Animate Adding a UIView, Call Function When the...
// Begin animation setup [UIView beginAnimations:nil context:NULL]; // Set duration for animation [UIView setAnimationDuration:1]; // Set function to be called when animation is complete [UIView setAnimationDidStopSelector: @selector(animDone:finished:context:)]; // Set the delegate (This object must have the function animDone) [UIView setAnimationDelegate:self]; // Set Animation type and...
Dec 4th
1 note
3 tags
Circle to Circle Collision Detection
- (BOOL) circle:(CGPoint) circlePoint withRadius:(float) radius collisionWithCircle:(CGPoint) circlePointTwo collisionCircleRadius:(float) radiusTwo { float xdif = circlePoint.x - circlePointTwo.x; float ydif = circlePoint.y - circlePointTwo.y; float distance = sqrt(xdif*xdif+ydif*ydif); if(distance <= radius+radiusTwo) return YES; return NO; }
Dec 4th