Available on the AppStore

Well love it …  or don’t play.  Our first game is up on the AppStore.

Image

The AppStore – Link   It went live on the AppStore Friday night!

Which is awesome and scary, We throw it to the wind and hope.. I guess.

The pain of provisioning profile, reared it’s ugly head in the last few hours before submission, I had to schlep myself over to “Ronchy” to get my friend Leanne help me. We ended up revoking my previous developer profile and reissuing it. For those of you in the same boat. Revoke and  make a new profile. reissue the provisioning profile, seems to be the easiest solution.

As a recommendation for a book:  Beginning iOS  5 Development  – Wei-Meng Lee is an excellent book. In desperation  I just followed his AppStore tutorial to the letter and Watabing Wataboom it worked like a charm.  After Leanne forced me to actually follow the steps instead of “yeah yah I did that” attitude we all have. Hahaha!!! trust me it will solve hours of frustration. Like Kurt Vonnegut says “read the Directions.”

Space Time and always looking into the past

We can never look into the future. Everything we experience has already happened.

The time it takes light to reach our eye means that everything we see is in the past.  The farther away it is, the more in the past it is. Take looking into the cosmos, as we peer further and further into deep space we see farther back in time; closer and closer to the Big Bang.  The light of those stars we see at night is in some cases millions of years old. Those star may have burnt out and the planets annihilated themselves, but because we look into their history we see what they were, many many years ago. To them we might just be slime mould crawling out of the proverbial primordial mud puddle of life.  It’s all Carl ‘Sagany’ stuff. but the thought of looking into the past of the universe. makes you feel really really fantastically small.

looking into timeframes

You decide to take your dog for a walk, you are lucky enough to see a Super Nova explode in the dusk sky. What you are seeing is multiple past event. They just happen to arrive at your eyes at the same ‘instant.’  You are seeing a collection of  various past events. “You are looking into the whole history of the universe all at once.” Brain melted yet????

“Space,” it says, “is big. Really big. You just won’t believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it’s a long way down the road to the chemist’s, but that’s just peanuts to space, listen…”  HHG – Douglas Adams

We egotistical monkeys, need to come to grips with the fact, that we are not all that fascinating, smart or pretty to anyone other than ourselves. But what are you going to do?  eh!  Have another pan galactic gargle blaster and watch some more telly.

Time is not Simple

Spacetime_curvature

As Einstein has taught us Time is not Simple.It squishes and expands depending on how fast or how close we are to a gravitational sources. That  said in programming it should be easy… But…

For the last weeks before submitting Dragon Emperor’s Challenge to the App Store, I’ve been fighting with Time.

Initially I programmed a timer by incrementing a counter every second.

Ala:

totalTimeInSeconds=0;
myTimer = [NSTimer scheduledTimerWithTimeInterval:
(1-(4/12)) // this is the time it take the animation to complete //
target:self
selector:@selector(updateTimer)
userInfo:nil
repeats:YES];

-(void)updateTimer
{
totalTimeInSeconds++;
// do update display stuff //
}

So simple. Stop incrementing totalTimeInSeconds when you want to pause. To save the time just save the integer value and restart it. Unfortunately due to rounding time delays in animation it sometimes it skips and basically doesn’t keep good time. So I had to what I am calling calculated time.

Where I store the date/time the timer is started.

startTime = [NSDate date];

Which is great if you don’t exit the game. But of course at sometime; why? I don’t know, but you may need to exit.      Dragon Emperor’s Challenge.  So you need to save the the amount of time on the clock. In defaults as a Double.

// Save the pause time interval //
NSUserDefaults *defaults= [NSUserDefaults standardUserDefaults];
[defaults setDouble:currentTime forKey:@”currentTime”];// then when you restart the clock //
// reset the Date to now //
startTime = [NSDate date];
NSUserDefaults *defaults= [NSUserDefaults standardUserDefaults];
currentTime = [defaults doubleForKey:@”currentTime”];
// and here is the key –> subtract the previous time on the clock from the current time
startTime = [[startTime dateByAddingTimeInterval:((-1)*(currentTime))]retain];
currentTime=0; // reset the currentTime.// restart the timer //
myTimer = [NSTimer scheduledTimerWithTimeInterval:(1-(4/12))
target:self
selector:@selector(updateTimer)
userInfo:nil
repeats:YES];
}

What’s a pain is that you need to pause/restart the timer when the app exits, wakes, switches, sleeps. and beta test for all that, including crashes and low memory warning.

** Just a note about sloppy programming. Before I had a number of flags that told me when Dragon Loaded and slept etc. Which meant I was trying to bandaid(tm) around all the options, sometimes subtracting the time, sometime not.. depending on the flag.. well that was a nightmare. Just Hack the arm off and replace it with something that does work instead putting patches on patches or in this case a plethora of if else if if statements !!!

So Time isn’t Simple, and it will make your brain hurt thinking about it. but also challenging and fun.. which is what keeps us alive.