/Code/src/com/game/InputDevice/JoystickInputDevice.java

https://bitbucket.org/DeveloperUX/behaviortree · Java · 61 lines · 35 code · 15 blank · 11 comment · 0 complexity · aebf496ffa24732de3146ed5201c6237 MD5 · raw file

  1. package com.game.InputDevice;
  2. import android.os.Handler;
  3. import android.os.Message;
  4. import android.util.Log;
  5. import android.view.MotionEvent;
  6. import com.game.MsgType;
  7. import com.game.Vec2;
  8. import com.game.Scenes.PlayScene;
  9. public class JoystickInputDevice extends InputDevice
  10. {
  11. Vec2 mainCirclePos;
  12. Vec2 dirCirclePos;
  13. public JoystickInputDevice(PlayScene playScene)
  14. {
  15. super(playScene);
  16. // TODO: Set this positions relative to device size
  17. this.mainCirclePos = new Vec2(10,165);
  18. this.dirCirclePos = new Vec2(50, 200);
  19. this.deviceHandler = new Handler()
  20. {
  21. public void handleMessage(Message msg)
  22. {
  23. }
  24. };
  25. }
  26. @Override
  27. public void Start()
  28. {
  29. // TODO Auto-generated method stub
  30. }
  31. @Override
  32. public void Update()
  33. {
  34. // TODO Auto-generated method stub
  35. }
  36. /**
  37. * Gets the main circle position
  38. * @return The main circle position
  39. */
  40. public Vec2 GetMainCirclePos() { return this.mainCirclePos; }
  41. /**
  42. * Gets the direction circle position
  43. * @return The direction circle position
  44. */
  45. public Vec2 GetDirCirclePos() { return this.dirCirclePos; }
  46. }