?? playerbullet.java
字號(hào):
package com.zk;
public class PlayerBullet {
int x;
int y;
int v;
int cont;
boolean islive=true;
PlayerBullet(int x,int y) {
this.x=x;
this.y=y;
this.v=20;
this.cont=0;
}
public void move(){
if(this.cont>=7){
this.cont=0;
}
this.y-=this.v;
this.cont++;
}
public void hit(int a,int b){
if(Math.abs((x+25)-(a+25))<26 && Math.abs((y+25)-(b+25))<26){
this.islive=false;
}
else{
this.islive=true;
}
}
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -