Is multitouch bugged? Test code in link.
Test project: http://s000.tinyupload.com/index.php?file_id=74259966883204030615
You will need to test it on device as it requires actual multi touching.
Basically there is a detector that detects whether you are touching the screen in the top or bottom half. From there, what happens is that if Touch.Count = 1, it increments the counter for top or for bottom, depending on which was pressed. There is no code for Touch.Count = 2 ; it is not meant to be handled for this test. The code for this is in the Touch Detector actor.
Here is how you break it. You will notice that if you tap two spots at the same time, nothing will happen. This is expected - we're not handling double touches. However, instead tap one half of the screen just barely before the other. What will happen is that the first half of the screen to be tapped will receive a double tap, whereas the half that is tapped last will receive no taps.
The code here is simple for demonstration's purposes. If you add even more checks, you'll find that even while Touch.Count = 1, the coordinates of the second tap will be stored in Touch2, rather than Touch1. But it will do this assignment before changing Touch.Count to 2, and after triggering a new Touch Pressed.
So, my question is, is this an actual bug or have I somehow overlooked something all day long?
Comments
No multitouch works fine. You need to understand how multitouch works. The touch count only registers how many touches are on the screen and is not related to touch is pressed or the touch assignments. I just built an 11 touch multitouch template and it all works perfect. Things happen so fast that it is also Curial how your code is ordered. A code scan happens in .03 of a second. See my videos on multitouch. Just click the link for videos in my signature.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS
Is the code scan timing why it can pass the rule for Touch.Count = 1 and yet assign to Touch.2 anyways? So that even if at the current scan, Touch.Count is claimed to be 1, I should check for more than 1 touch anyways?
I understand that the which touch is assigned to has nothing to do with touch count, but I would have thought that if touch count is 1, then there would be no reason to assign to touch 2, especially when touch count is really 2... but it passes the rule for touch.count = 1.
Since you have the screen divided top and bottom I wouldn't bother using the touch count at all. Watch my video on a two touch game. I show you how to divide the touch based on each half of the screen. If I have a chance tomorrow I'll look at your file but I know there is a better way without using the touch count or even multitouch since you just want to see if the top or bottom is touched.
Guru Video Channel | Lost Oasis Games | FRYING BACON STUDIOS