坦克大战java源代码
19页1、有些图片路径会出错 要注意 package com.tankgame;/坦克类class Tankint x=0;int y=0;int color=0;int speed=1;int direct=0;boolean isLive=true;public Tank(int x,int y)this.x=x;this.y=y;public int getX() return x;public void setX(int x) this.x = x;public int getY() return y;public void setY(int y) this.y = y;public int getDirect() return direct;public void setDirect(int direct) this.direct = direct;public int getColor() return color;public void setColor(int color) this.color = color;/我的坦克class Hero extends TankShot s
2、hot=null;Vector shotm=new V ector(); public Hero(int x,int y)super(x,y); this.color=5;/坦克具有一个打击敌人的方法public void shotenemy(int x,int y,int direct)switch(direct)case 0:shot=new Shot(this.x+10,this.y,0); shotm.add(shot);break; case 1:shot=new Shot(this.x+30,this.y+10,1); shotm.add(shot);break; case 2:shot=new Shot(this.x+10,this.y+30,2); shotm.add(shot);break; case 3:shot=new Shot(this.x,this.y+10,3); shotm.add(shot);break;Thread th=new Thread(shot); th.start();/调整速度public void moveup() y-=speed;pu
3、blic void moveright() x+=speed;public void movedown() y+=speed;public void moveleft() x-=speed;/敌人的坦克class EnemyTank extends Tank implements Runnable Vectorensh=new Vector(); Vectorets=new Vector(); public EnemyTank(int x, int y) super(x, y); this.setColor(2); this.setDirect(2);/获取 MPanel 上的敌人坦克public void setets(Vector vv)this.ets=vv;/判断敌人的坦克是否碰撞public boolean isTouch()boolean b=false;EnemyTank et=null;switch(direct)case 0:for(int i=0;i=et.x&this.x=et.x+20&this.yet.y)return true;if(this.x+20=et
《坦克大战java源代码》由会员cn****1分享,可在线阅读,更多相关《坦克大战java源代码》请在金锄头文库上搜索。
突发环境事件应急预案(上传)
语文排序题做题方法及习题
宴请及招待制度
1111皮带顺槽过断层措施1211
中医执考妇科常用方剂方歌
护理年度个人工作总结标准范文(4篇).doc
2021年家长会教师演讲稿.doc
洁净厂房维修合同文本
大雁站分部工程施工方年案
一年级上册组词联系
东北大学21秋《现代机械设计理论与方法》平时作业二参考答案79
2014年适宜结婚的日子大全
三明美容美妆工具项目可行性研究报告(参考模板)
精选财物年终工作总结报告(3篇).doc
Photoshop制作玻璃球效果
2023年安徽省合肥市肥东县马湖乡马湖社区工作人员考试模拟试题及答案
青年志愿团三月工作总结模板(3篇).doc
送给同事的经典生日祝福语
东北农业大学21秋《电子商务》案例平时作业2-001答案参考91
上班抽烟检讨书范文
2023-05-01 1页
2023-08-29 17页
2023-06-23 5页
2023-05-15 10页
2023-08-05 61页
2023-08-05 17页
2023-02-20 13页
2022-12-09 3页
2022-09-08 15页
2023-06-05 8页