Tested my first iphone game on device

MathIsFun2
I feel so happy to get my opensource game tested on some real devices. The game got tested with iphone3GS, iphone4 and ipodtouch2G. Thanks to all my friends to help me with this. You all rock. And with that I come to a point where may be this game is pushed to Appstore. The tests were good and made some changes as per the retina display of new iPhone4.
Overall it is nice experience to see my game on device.
Cheers to life.

My opensource iphone game now supports accelerometer

I have made some improvements since my last post about the game. The game (Math Is Fun 2) now supports accelerometer. The new version of the game is having below mentioned additions and updations to it.

1. Accelerometer support ( The game mode is now changed by changing phone’s direction )
2. A counter is added ( Which changes question in every 1000 count )
3. Game now displays, total questions played ( asked )
4. Total number of correct answers given by user is displayed
5. Total number of wrong answers given by user is displayed

The code is on GitHub and licensed under Unlicense.

My first iphone game goes opensource

I have recently finished an iphone game. This is written in Sparrow framework. I have decided to make it opensource and so put it up on github at this link. The game is very simple and is licensed under Unlicense. So there is no restriction as to how to use the code. You can use it to make money or what so ever as this licensing does not force you to do anything you do not need to do.
About the game, its a simple game of Mathematics for small kids. There are options for addition, subtraction, multiplication and division. Choose your type to play and go ahead playing it. There is no score, no time limit. The responses are immediate. So one will know whether correct or incorrect answer.
While I am developing on it too. Will love to see what others can do with it. This can be seen as code example for the Sparrow framework as well.

Making a default icon and a splash screen for your iphone app?

This is a real surprise to me, when I was trying to search as to how to make an icon for my game on the iphone screen. Along with this came in the simplicity to create a splash screen for the same game. First thought there would be some procedure involved in it. Then it seemed the procedure is to name two files as per the naming convention (yes, its not configuration but convention, the principle of convention over configuration) and then rest is just taken care of.
So if we put 2 images inside our project resources folder and name them as “Icon.png” and “Default.png” we are done with the making of our icon and splash screen.
Well, the sizes also take some importance, in my case “Icon.png” is of “57×57″ and “Default.png” is of “320×480″ px. If after naming appropriately the icon and the splash screen do not show, up make sure that their dimensions match exactly as mentioned now.

Hope that helps someone out there.

NSLog options

I always have a problem understanding the log syntax of objectiveC. So putting down it here. I have taken this from the original link, which is at CocoaDev website.

%@     Object
%d, %i signed int
%u     unsigned int
%f     float/double

%x, %X hexadecimal int
%o     octal int
%zu    size_t
%p     pointer
%e     float/double (in scientific notation)
%g     float/double (as %f or %e, depending on value)
%s     C string (bytes)
%S     C string (unichar)
%.*s   Pascal string (requires two arguments, 
           pass pstr[0] as the first, pstr+1 as the second)
%c     character
%C     unichar

%lld   long long
%llu   unsigned long long
%Lf    long double

Happy Logging

Selector without any parameter

Well, let me face it. It took me sometime to write a simple selector, which does not take any parameter and then to successfully call it. The solution is overly simplified. If at all one need to define a selector, which does not take any parameter, it should be as below

- (void) myMethod
{
//Do Something
}

The call to this selector is also the simplest of all forms

[myObj myMethod]

Now, that may be confusing at some point as it confused me. The reason being, it is a general convention to see selectors with a “:” at the end. So in general terms a selector is known as with a “:” as

myMethod: , onUserCall:

etc. So the point is, if its defined not to take any parameters or does not take any arguements in its definition, then the method call will be just the selector name else it would always be with a “:”.