📄 corps.java
字号:
/**
* <p>Title: Transpanzer</p>
* <p>Description:
* You cannot remove this copyright and notice.
* You cannot use this file any part without the express permission of the author.
* All Rights Reserved</p>
* @author Jjyo
* @email jjyo@163.com
* @version 1.0.0
*/
public class Corps extends FSprite{
GameManage gm;
public byte corpsType;
public static final byte BRICK=1;
private int count;
public Corps(GameManage gm,int x,int y,byte corpsType){
this.gm=gm;
this.x=x;
this.y=y;
isHidden=false;
this.corpsType=corpsType;
frameCnt=35;
}
public void action(){
if(!isHidden){
if(x<-32||x>TankGameCanvas.width+32||y<0||y>TankGameCanvas.height){
return ;
}
switch(corpsType){
case BRICK:
boolean round=false;
if(x-gm.lgr.tankSprite.x<40&&x-gm.lgr.tankSprite.x>-20){
round=true;
}
if(TankSprite.HYPER_BEAM){
if(round){
if(++timeCnt%10==0&&count<3){
y-=16;
count++;
}
}else{
if(++timeCnt%10==0&&count>0){
y+=16;
count--;
}
}
}
break;
}
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -