View Single Post
Posts: 1,522 | Thanked: 392 times | Joined on Jul 2010 @ São Paulo, Brazil
#21
The joypad algorithm for example, would work like this:



On one side, lets pick the right one, you draw a thumbstick, with your right thumb you can drag it to anywhere you want within it's range (the circle or square area representing the range of motion of the stick), depending on the desired mechanics it will either snap to center or rest where you left it when you raise your finger.


On the left side, you draw several buttons (i imagine around 9 might already be pushing the algorithm to it's limits), the distribution of the buttons and the positioning and size of the group would matter, some configurations would make it too hard for tunning the algorithm. The buttons you must never slide from one to another (perhaps if they were just a vertical line of a few buttons sliding can work), you should lift your thumb and then press down on the next button.


The two sides can be used concurrently (that means you use each one without needing to interfeer with the use of the other.


The key part is the algorithm to separate the two inputs. With the N900's sensor, two touches result in the cursor being placed in point between two touches, and if you touch them one and then the other, the cursor will jet from the position of the first towards the midpoint. This is the building block of the pure screen algorithms.


If it is just the joypad being used the cursor stays in the joypad area.
If it is just the buttons being used, the cursor stays over one of the buttons.

And now the interesting part:

If the joypad is being used and then a button is pressed, the cursor will jump from the last joypad to the point midway between that and the pressed button, which gives you which button is pressed.

If a button is being held down and then you pull on the joypad, the cursor will jump to the position between the button and the current joypad position.

And when a button is pressed and you wiggle the joypad around, you already know which button is pressed, so it's just a matter of extrapolating the joypad position.


Questions?





ps:it might involve a little bit of practice depending on how you usually touch the screen with your thumbs, the position of the cursor with two fingers on is the average of the two contact points, but it's an average weighted by the pressure of each thumb (with a little practice you can wiggle the cursor back and forth between the thumbs)