资源简介
用java写的窗体RPG小游戏,纯手工可运行
代码片段和文件信息
/*
* To change this template choose Tools | Templates
* and open the template in the editor.
*/
package demo;
/**
*
* @author Administrator
*/
public class Battle {
String definition;
String definition2=“ “;
// Monster[] monster =new Monster[3];
int aim;//判断被攻击的怪物
//战斗属性初始化
public void battleBegin(Player player){
player.attactt = player.attact;
player.defencee = player.defence;
player.speedd = player.speed;
player.state = 0;
}
//结束后获得经验值 和 金钱
public void getExp(Monster monsterMonster monster2Monster monster3Player player){
int temp =(int)((monster.strength + monster.intelligence + monster.speed +
monster2.strength + monster2.intelligence + monster2.speed +
monster3.strength + monster3.intelligence + monster3.speed)*(Math.random()+0.5)) ;
player.xpp+=temp;
int temp2 = (int)((monster.strength + monster.intelligence + monster.speed +
monster2.strength + monster2.intelligence + monster2.speed +
monster3.strength + monster3.intelligence + monster3.speed)*(Math.random()+0.5)) ;
player.money+=temp2;
new Textdialog(player.name+“获得经验 “+ temp + “ 获得金钱 “+temp2);
}
public void getExp(Monster monsterMonster monster2Player player){
int temp =(int)((monster.strength + monster.intelligence + monster.speed +
monster2.strength + monster2.intelligence + monster2.speed)*(Math.random()+0.5)) ;
player.xpp+=temp;
int temp2 = (int)((monster.strength + monster.intelligence + monster.speed +
monster2.strength + monster2.intelligence + monster2.speed )*(Math.random()+0.5)) ;
player.money+=temp2;
new Textdialog(player.name+“获得经验 “+ temp + “ 获得金钱 “+temp2);
}
public void getExp(Monster monsterPlayer player){
int temp =(int)((monster.strength + monster.intelligence + monster.speed )*(Math.random()+0.5)) ;
player.xpp+=temp;
int temp2 = (int)((monster.strength + monster.intelligence + monster.speed)*(Math.random()+0.5)) ;
player.money+=temp2;
new Textdialog(player.name+“获得经验 “+ temp + “获得金钱 “+temp2);
}
//判定战斗是否结束
public int checkBattle(Player playerPlayer player2Player player3){
if(player.hpp==0&&player2.hpp==0&&player3.hpp==0)return 1;
else return 0;
}
public int checkBattle(Player playerPlayer player2){
if(player.hpp==0&&player2.hpp==0)return 1;
else return 0;
}
public int checkBattle(Player player){
if(player.hpp==0)return 1;
else return 0;
}
public int checkBattle(Monster playerMonster player2Monster player3){
if(player.hpp==0&&player2.hpp==0&&player3.hpp==0)return 1;
else return 0;
}
public int checkBattle(Monster playerMonster player2){
if(player.hpp==0&&player2.hpp==0)return 1;
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2014-10-16 09:39 RPGGame\
文件 302 2013-11-24 15:23 RPGGame\.classpath
文件 383 2013-11-24 15:23 RPGGame\.project
目录 0 2014-10-16 09:39 RPGGame\.settings\
文件 88 2013-11-24 15:25 RPGGame\.settings\org.eclipse.core.resources.prefs
文件 629 2013-11-24 15:23 RPGGame\.settings\org.eclipse.jdt.core.prefs
目录 0 2014-10-29 10:48 RPGGame\bin\
目录 0 2014-10-16 09:39 RPGGame\src\
目录 0 2014-10-16 09:39 RPGGame\src\demo\
文件 14850 2013-11-24 15:25 RPGGame\src\demo\Battle.java
文件 3096 2014-10-16 13:59 RPGGame\src\demo\Character.java
文件 3556 2013-11-24 15:25 RPGGame\src\demo\Choosedialog.java
文件 5143 2013-11-24 15:36 RPGGame\src\demo\Choosedialog1.java
文件 9506 2013-11-24 16:30 RPGGame\src\demo\Equipdialog.java
文件 2254 2013-11-24 16:28 RPGGame\src\demo\Equipment.java
文件 20127 2013-11-24 15:25 RPGGame\src\demo\Fightdialog.java
文件 4899 2013-11-24 16:18 RPGGame\src\demo\Filedialog.java
文件 2167 2014-10-16 13:56 RPGGame\src\demo\Gamefr
文件 8981 2013-11-24 16:18 RPGGame\src\demo\Homedialog.java
文件 2137 2013-11-24 16:14 RPGGame\src\demo\Item.java
文件 9324 2013-11-24 16:14 RPGGame\src\demo\Itemdialog.java
文件 5275 2013-11-24 16:25 RPGGame\src\demo\Judialog.java
文件 10883 2013-11-24 17:10 RPGGame\src\demo\Mappanel.java
文件 2539 2013-11-24 16:56 RPGGame\src\demo\Monster.java
文件 1226 2013-11-24 15:25 RPGGame\src\demo\Music.java
文件 8936 2013-11-24 16:22 RPGGame\src\demo\Pla
文件 1689 2013-11-24 15:25 RPGGame\src\demo\Propdialog.java
文件 6171 2013-11-24 16:21 RPGGame\src\demo\Skill.java
文件 18435 2013-11-24 15:25 RPGGame\src\demo\Statedialog.java
文件 1838 2013-11-24 16:20 RPGGame\src\demo\Statepanel.java
文件 1543 2013-11-24 15:25 RPGGame\src\demo\Textdialog.java
............此处省略79个文件信息
评论
共有 条评论