标签:
自己练手的一个小项目,还有少量bug,路过的看一看瞧一瞧,请大家指教=.=
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
|
protected
void
onDraw(Canvas canvas) { for
( int
i = 0 ;
i < mybulletlist.size(); i++) { if
(mybulletlist.get(i).getX() > 380 ||
mybulletlist.get(i).getX() < 0 ||
mybulletlist.get(i).getY() > 700 ||
mybulletlist.get(i).getY() < 0 )
{ mybulletlist.remove(i); } } for
( int
i = 0 ;
i < bulletlist.size(); i++) { if
(bulletlist.get(i).getX() > 380
|| bulletlist.get(i).getX() < 0 ||
bulletlist.get(i).getY() > 700 ||
bulletlist.get(i).getY() < 0 )
{ bulletlist.remove(i); } } if
(!bulletlist.isEmpty() && !mybulletlist.isEmpty()) { mytank_die(bulletlist); tank_die(mybulletlist,
tanklist); } if
(mytank == null )
{ }
else
{ if
(mytank.getZ() == 1 )
{ turn_right(canvas,
mytank.getX(), mytank.getY()); }
else
if
(mytank.getZ() == 2 )
{ turn_down(canvas,
mytank.getX(), mytank.getY()); }
else
if
(mytank.getZ() == 3 )
{ turn_left(canvas,
mytank.getX(), mytank.getY()); }
else
if
(mytank.getZ() == 4 )
{ turn_up(canvas,
mytank.getX(), mytank.getY()); } } if
(tanklist.isEmpty()) { }
else
{ tank_turn(canvas); } if
(bulletlist.isEmpty()) { }
else
{ bullet_turn(canvas); } if
(mybulletlist.isEmpty()) { }
else
{ mybullet_turn(canvas); } } |
标签:
原文地址:http://blog.csdn.net/u014311037/article/details/42805369