資源簡介
貪吃蛇游戲(雙人)JAVA源碼 貪吃蛇游戲(雙人)JAVA源碼

代碼片段和文件信息
/**
*?食物類
*/
public?class?Food?{
????private?int?x;
????private?int?y;
????private?boolean?has;
???
????public?Food()?{
????????super();
????}
????public?void?getFood(){
????????int?temp?=?new?java.util.Random().nextInt();
????????if?(temp<0)
????????????temp*=-1;
????????x?=?(temp%43+1)*15;??????????//邊到660?可取到645??X取15的(1~43)倍;
????????y?=?(temp%35+1)*15;????????????????//邊到540?可取到525??Y取15的(1~35)倍;
????????has?=?true;
????}
????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?boolean?isHas()?{
????????return?has;
????}
????public?void?setHas(boolean?has)?{
????????this.has?=?has;
????}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件?????????791??2008-07-29?01:51??Food.java
?????文件???????15094??2008-07-29?01:51??KeyboardPanel.java
?????文件?????????609??2008-07-29?01:51??Platform.java
?????文件????????1233??2008-07-29?01:52??SankeBody.java
- 上一篇:thumbnailator-0.4.8.jar
- 下一篇:保存計算過程的計算器
評論
共有 條評論