2024年4月1日发(作者:)

24 private DrawPhysics drawPhysics;

25 private LogicPhysics logicphysic;

26 Paint paint;

27 private GestureDetector gestureScanner;

28 String Tag="GameView";

29 public GameView(Context context) {

30 super(context);

31 // TODO Auto-generated constructor stub

32 drawPhysics=new DrawPhysics();

33 logicphysic=new LogicPhysics();

34 paint = new Paint();

35 gestureScanner=new GestureDetector(this);

36 oubleTapListener(this);

37

38 setBackgroundColor();

39 or();

40 }

41

42 @Override

43 protected void onDraw(Canvas canvas) {

44

45 ysics(canvas, paint);

46 (canvas);

47

48 }

49 @Override

50 public boolean onTouchEvent(MotionEvent event) {

51 //postInvalidate();

52 hEvent(event);

53 invalidate();

54 return true;

55 }

56

57 public boolean onDoubleTap(MotionEvent e) {

58 // TODO Auto-generated method stub

59 Log.d(Tag, "onDoubleTap");

60 return false;

61 }

62

63 public boolean onDoubleTapEvent(MotionEvent e) {

64 // TODO Auto-generated method stub

65 Log.d(Tag, "onDoubleTapEvent");

66 return false;

67 }

68

69 public boolean onSingleTapConfirmed(MotionEvent e) {

70 // TODO Auto-generated method stub

71 Log.d(Tag, "onSingleTapConfirmed");

72

73 Select();

74 return false;

75 }

76

77 public boolean onDown(MotionEvent e) {

78 // TODO Auto-generated method stub

79 float x=();

80 float y=();

81 int i;

82 Log.d(Tag, "onDown");

83

84 i=elected(x,y);

85 if(i<7){

86 ect(i);

87 Log.d(Tag,"get one physic");

88 }else{

89 Select();

90 Log.d(Tag,"get null physic");

91 }

92 return false;

93 }

94

95 public boolean onFling(MotionEvent e1, MotionEvent e2, float velocityX,

96 float velocityY) {

97 // TODO Auto-generated method stub

98 Select();

99 Log.d(Tag, "onFling");

100 return false;

101 }

102

103 public void onLongPress(MotionEvent e) {

104 // TODO Auto-generated method stub

105 essEvent((), ());

106 Log.d(Tag, "onLongPress");

107 }