Welcome to my Programming Blog...

I am currently working on a couple of projects: An original game called "Implosion" which I am porting from Flash to the iPad, and a remake of Q*bert in Python (pygame), as part of the class I am teaching. Please feel free to use the "Labels" (at right) to follow a specific project or theme. If you are one of my Python students, I recommend that you check out the Python thread.

Monday, January 17, 2011

SneakyInput - addendum

I've promised a few of you instructions on how to handle multiple touches, but before I do, here is an answer to a more specific question: how do I get a SneakyJoystick and a SneakyButton to work at the same time? In other words, can I move my ship with my left thumb while I fire the guns with my right?
The version of the ShooterGame we wrote together would not do this. It turns out that it is a one-line change to fix this!
You have to go into the file that is called "yourProgramAppDelegate.m" (of course, it has your program name there, not "yourProgram"....) Partway through the "applicationDidFinishLaunching:" function, there is a line where the variable "glView" is created:
EAGLView *glView = [EAGLView viewWithFrame:...... and so forth, for about 4 lines.
Sometime after those lines, but still in the applicationDidFinishLaunching: function, add the following line:
[glView setMultipleTouchEnabled:YES];
... and that should fix it!


(For the curious, this post is where I found this solution.)
(Thanks to Patrick, who found a typo in the one line that you actually need to type in! It's fixed now.)

No comments:

Post a Comment