Lua : My experience with it.

Well, on my journey with mobile development, I picked up Lua for sometime. I am quite impressed with its simplicity and power. If you do not know, Corona SDK provides Lua scripting language to build applications for mobile devices. The popular Angrybirds game utilises the power of Lua.
Basically its a simple language with very minimum number of key words and language syntaxes. Anyone familiar with javascript or actionscript can start jumping into it and be productive from day one. There are variants of the installer for Mac and Windows. Some what I feel Windows installer is the best and has got its own IDE, which is on top of popular SciTE IDE.
There is a complete 2D game engine / framework for Lua named Love. With that one can instantly start creating Lua games. As Lua is simple, so as Love is. But then one gets a whole lot of goodies out of a framework. I would say a must try for any game developer.
There is a nice framework for iPhone, which uses Lua and its called WAX. This also fits Lua’s philosophy as to keep the framework simple and easy. The best part is, once you start coding in WAX, you do not have to think about memory management, which is very important and sometimes most time consuming act, while developing application with ObjectiveC.
Now that I have seen Lua’s power and simplicity, I will try that out more and more and post updates about my experiments. Here are some Lua related links for you to get used to
1. Users, tutorials and more
2. Love : 2D game engine
3. WAX : iOS development framework
4. 2D Engine A 2D game engine (I Have not tried yet)
5. Luxinia 3D game engine (I have not tried yet)
6. Lua Forge Projects, tutorials and more
7. Baja Engine A game engine (I have not tried yet)

With that I think I also have to pick up some engines and start playing with it. Overall, Lua feels just perfect as its simplicity and power. Its portable and lightweight. After all its Opensource and Free.

Making random numbers in ObjectiveC, the quick and dirty way.

This is another part of my iphone development experience, where I really feel the pain over and again. So putting up my quick way to do get a random number. There are a lot of methods regarding the random number generation in objectiveC and there are even third party attempts to get the best random number possible.
The three most obvious functions are rand(),random() and arc4random(). While a lot can be heard around of not getting a random number by the first two functions, the last options is better. At least I get decent random numbers with it.
Now to get a random number between 2 points, the code would be

//random number between 0 and 5 not 5, till 4
int i=arc4random()%5;
//random number between 10 and 15 not 15, till 14
int j=10 + arc4random()%5;

Hope that makes my next random number creation search leads me to look at this post.
Happy coding :)

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.