Accelerometer in the iPhone Simulator
It can be a frustrating and time consuming task to work with the accelerometer feature in iPhone development. The iPhone Simulator does not come with any built-in capabilities to receive accelerometer events from factory.
Some developers accomplished a way to simulate it in the Simulator. One technique involves using a third party library that generate events and send them to your program. Another technique is kind of esoteric, as it reads your internal MacBook accelerometer and handle them as they would come from an iPhone. I just can’t imagine myself turning my MacBook upside-down just to test our game
I got a simple solution to simulate it. First I call the accelerometer from my update function (notice that I’m using a preprocessor macro), using nil as parameters:
#ifdef ACCELEROMETER_SIM [self accelerometer:nil didAccelerate:nil]; #endif
Then, on the accelerometer function, I test the program directly inputting the vectors that I need to test. In this case I want to test the Y axis:
- (void)accelerometer:(UIAccelerometer*)accelerometer didAccelerate:(UIAcceleration*)acceleration
{
// Use a basic low-pass filter to keep only the gravity component of each axis.
mAccelX = (acceleration.x * FILTER) + (mAccelX * (1.0 - FILTER));
mAccelZ = (acceleration.z * FILTER) + (mAccelZ * (1.0 - FILTER));
#ifdef ACCELEROMETER_SIM
mAccelY = (-1.0f * FILTER) + (mAccelY * (1.0 - FILTER));
#else
mAccelY = (acceleration.y * FILTER) + (mAccelY * (1.0 - FILTER));
#endif
}
It’s super simple, and you can have your tests right from your iPhone Simulator. No more uploading to device just to test
RealNetworks 1st party dev gone to heaven
Things are changing again in casual games development and market. While some indie developers are getting their share of attention, some publishers are in need to correct their heading as fast as they can.
A good example can be RealNetworks layoffs. Their 1st party dev team is no longer working at GameHouse. They have few titles published in-house, and all portal operations will continue to go on, now only with 3rd party and 2nd party contracts. It just shows how rough times internal studios are living everywhere.
RealNetworks said it will continue to focus on social networks, but there is a kind of runaway train heading to social gaming like those in Facebook. It is even harder to define how casual gaming works in social networks. It can be appropriate to call it social gaming. Anyway it is not just another bandwagon, so publishers and developer must pay extra attention when dealing with these markets.
See also
- Blog ·· 10 Titles to check on XBLIG
- Cashtown ·· All the colors and art of a time
- Cashtown ·· Dealing with NSCalendar and dates
- Our business ·· Indie
- How we work ·· Our games are exclusive
- Blog ·· Playdom acquires Merscom
- Blog ·· No Flash on iPhone
- Our business ·· Third-party
- Cashtown ·· A bit of its way of thinking


