Android Accelerometer moving ball

前端 未结 2 979
谎友^
谎友^ 2021-02-01 10:58

i have done developed a sample application with the help of tutorials posted on web. my aim is to access the accelerometer and move a ball as per the phone orientation. i was s

2条回答
  •  不要未来只要你来
    2021-02-01 11:42

    I would set SENSOR_DELAY constant to

    SENSOR_DELAY_FASTEST 
    

    See if that fixes it. This should help the stutter problem. Also I think your boundary checks are wrong since xmax and ymax values are given display.getWidth/getHeight Maybe you should feed it your BitMap width and height boundaries to the xmax and ymax values.

提交回复
热议问题