How can I Implement acceleration iOS

tadrianotadriano USMember

How can I implement acceleration iOS with cocosSharp ? I'M trying this code below:

follow a link to my code on dropbox:
https://www.dropbox.com/s/uswzhovolzfdgtv/BouncingGameCompleteiOS.zip?dl=0

            var acc = new CCEventListenerAccelerometer ();
    acc.IsEnabled = true; //  inputManager.setAccelerometerEnabled(true);

    acc.OnAccelerate = (e) => {
        // HOW TO INTERPRET e.Acceleration.X / Y / Z
        paddleSprite.PositionX = (float)e.Acceleration.X;

    };

    this.AddEventListener(acc,this);
Sign In or Register to comment.