0

I'm making an android game. I have a cube that moves forward by applying force on it (so when i colide i get a better effect) so now i need help to make controls for android. I tried making buttons but i cant get them to (while holding it down) apply force to left or right constantly.

Phantômaxx
  • 37,901
  • 21
  • 84
  • 115
Faris
  • 3
  • 3

1 Answers1

0

You need to set an OnTouchListener on the button. And start applying force when the user presses the button, which is ACTION_DOWN event, until user lifts his finger, which is ACTION_UP event. You need to optimise for dragging and multi-finger.

Ravjit Singh
  • 798
  • 5
  • 17