I’m trying to port my game from OpenGL to Android…I was using the mouse in OpenGL, but now I’m doing touch. Unfortunately my tap code only works when I set a break point and step thru it in the debugger. But otherwise it doesn’t work at all.
I have this defined:
private TouchLocation touch; private bool tap => touch.State == TouchLocationState.Released;
Then in my Update method I have this defined:
var touchCollection = TouchPanel.GetState(); touch = touchCollection.Count > 0 ? touchCollection[0] : default(TouchLocation); var point = dragonDrop.viewport.PointToScreen((int)touch.Position.X, (int)touch.Position.Y); if (tap) { ... }
I’m confused, why would the code work when I step thru but not at all otherwise? I’m debugging it on a real droid tablet with KitKat 4.4.