Android onscreen joystick issues

后端 未结 2 1518
难免孤独
难免孤独 2021-01-06 05:23

So I\'m trying to build a game with an on-screen joystick that moves a bitmap around the screen. But when I hold the joystick down in any direction and keep it there, the bi

2条回答
  •  既然无缘
    2021-01-06 05:59

    It was because I only had the code to increment the bitmaps location in the onTouch method. When the screen is being touched but not moving a event is not registered. The code below should be outside the onTouch method.

    bitmapPoint.x += a * .05;
    bitmapPoint.y += b * .05;
    

提交回复
热议问题