Galcon Games
Phil Hassey - game dev blog
Phil Hassey as Snidely Whiplash
"You can't buy awesomeness.
You're born that way."

Stealth Target: Day 36 – More iPad support

So, Nan did a test run of the iPad version of Stealth Target today. There’s always a handful of platform issues to deal with in porting!

Like, on the iPad I don’t need a Quit button!

Or, I need to use some ObjectiveC code to open a web page. Thanks to OS 4.x I won’t need to figure out how to embed web browsing in the game due to multi-tasking support. I haven’t added that to the game yet, but I’ll do that before release. (Which reminds me to add that to my tracker so I don’t forget!)

As always, I need to modify the interface a bit more for touch. The mouse and touch interfaces are really quite different, so I always want to make the experience work “the best” given the interface being used.

A new challenge for me is adding pinch to grow/zoom support to the game. In the desktop version the mouse-wheel controls this. To implement this for a touch interface, I need to track where the center of all touch events is, so when a motion happens I can see if that motion is going towards or away from the center. This is a bit tricky, since finding where the center of a multi-touch event keeps changing as motion keeps happening.

I found that technique didn’t work. What did work was passing along with the event a distance value between that touch and each other touch. This way, no matter how many touches are down, a reasonable zoom value will be passed.

-Phil

Comments are closed.