package t1;
public class BaoZha {
int x, y;
int shengcunqi = 9;
boolean shengming = true;
public BaoZha(int x, int y) {
super();
this.x = x;
this.y = y;
}
public void scqjs() {
if (shengcunqi > 0) {
shengcunqi--;
} else {
this.shengming = false;
}
}
}
package t1;
import java.util.Vector;
import t1.DiTank;
class DiTank extends Tank implements Runnable
{
int time=0;
Vector dzd=new Vector();
Vector dtk;
public Vector getDtk() {
return dtk;
}
public void setDtk(Vector dtk) {
this.dtk = dtk;
}
public DiTank(int x, int y) {
super(x, y);
}
public boolean hxpz() {
boolean b=false;
switch (fangxiang){
case 0:
for(int i=0;i
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0dt.fangxiang==2)
{
if(this.x>=dt.x && this.x<=dt.x+20 && this.y>=dt.y && this.y<=dt.y+30)
{
return true;
}
if(this.x+20>=dt.x && this.x+20<=dt.x+20 && this.y>=dt.y && this.y<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3dt.fangxiang==1)
{
if(this.x>=dt.x && this.x<=dt.x+30 && this.y>=dt.y && this.y<=dt.y+20)
{
return true;
}
if(this.x+20>=dt.x && this.x+20<=dt.x+30 && this.y>=dt.y && this.y<=dt.y+20)
{
return true;
}
}
}
}
break;
case 1:
for(int i=0;i
{
DiTank dt=dtk.get(i);
if(dt!=this)
{
if(dt.fangxiang==0dt.fangxiang==2)
{
if(this.x>=dt.x&&this.x<=dt.x+20&&this.y>=dt.y&&this.y<=dt.y+30)
{
return true;
}
//下一点
if(this.x>=dt.x&&this.x<=dt.x+20&&this.y+20>=dt.y&&this.y+20<=dt.y+30)
{
return true;
}
}
if(dt.fangxiang==3dt.fangxiang==1)
{
if(this.x>=dt.x&&this.x<=dt.x+30&&this.y>=dt.y&&this.y<=dt.y+20)
{
return true;
}
if(this.x>=dt.x&&this.x<=dt.x+30&&this.y+20>