Beispiel #1
0
        private void notifyAccelerometerEvent(int playerIndex, int x, int y, int z, int maxAccelX, int maxAccelY, int maxAccelZ)
        {
            int newX, newY, newZ;

            newX = (int)((x * accelX) / Math.Abs(maxAccelX));
            newY = (int)((y * accelY) / Math.Abs(maxAccelY));
            newZ = (int)((z * accelZ) / Math.Abs(maxAccelZ));

            AccelerometerEvent ae = new AccelerometerEvent(playerIndex, newX, newY, newZ);

            Thread t = new Thread(new ThreadStart(delegate()
            {
                onAcceleratorEvent(ae);
            }));

            t.Start();

            //TODO : lancer le thread qui va appeler la fonction event
        }
Beispiel #2
0
 public abstract bool onAcceleratorEvent(AccelerometerEvent ae);