资源简介
java 课程设计大作业 写的一个RPG游戏(代码+文档)
java 课程设计大作业 写的一个RPG游戏(代码+文档)

代码片段和文件信息
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.Serializable;
import javax.swing.*;
public class ActMenu extends JPanel implements Serializable {
Jframe options = new Jframe(“选项“);
JButton[] buttons = { new JButton(“战斗“) new JButton(“当前出战“) new JButton(“背包“) new JButton(“商店“)
new JButton(“基地“) new JButton(“选项“) };
JButton[] ops = { new JButton(“继续游戏“)new JButton(“保存游戏“) new JButton(“读取存档“)new JButton(“ 帮助 “)};
public ActMenu() {
setLayout(new FlowLayout());
options(options);
for (int index = 0; index < buttons.length; index++)
buttons[index].addActionListener(new ActLis());
for (int index = 0; index < buttons.length; index++)
add(buttons[index]);
}
public void shutdown() {
for (int index = 0; index < run.frames.length; index++)
run.frames[index].setVisible(false);
}
private class ActLis implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == buttons[0]) {
shutdown();
run.frames[1].setVisible(true);
} else if (e.getSource() == buttons[1]) {
shutdown();
run.frames[2].setVisible(true);
} else if (e.getSource() == buttons[2]) {
shutdown();
run.frames[3].setVisible(true);
} else if (e.getSource() == buttons[3]) {
shutdown();
run.frames[4].setVisible(true);
} else if (e.getSource() == buttons[4]) {
shutdown();
run.frames[5].setVisible(true);
} else if (e.getSource() == buttons[5]) {
options.setVisible(true);
}
}
}
//选项按钮
public void options(Jframe options) {
JPanel[] three = new JPanel[4];
options.setLayout(new GridLayout(3 1));
for (int index = 0; index < three.length; index++) {
three[index] = new JPanel();
ops[index].addActionListener(new OpLis());
three[index].add(ops[index]);
options.add(three[index]);
}
options.setPreferredSize(new Dimension(300 200));
run.screencentre(options);
options.pack();
}
private class OpLis implements ActionListener {
public void actionPerformed(ActionEvent e) {
if (e.getSource() == ops[0]) {
options.setVisible(false);
}
else if(e.getSource()==ops[1]){
S_L.Save();
JOptionPane.showMessageDialog(null “游戏已保存“ “保存“ JOptionPane.INFORMATION_MESSAGE);
options.setVisible(false);
}
else if(e.getSource()==ops[2]){
S_L.Load();
JOptionPane.showMessageDialog(null “存档已载入“ “读取存档“ JOptionPane.INFORMATION_MESSAGE);
options.setVisible(false);
}
else if(e.getSource()==ops[3]){
run.begin.help.setVisible(true);
options.setVisible(false);
}
}
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-04 23:54 Images\
文件 18327 2018-03-04 23:54 Images\1.jpg
文件 14354 2018-03-04 23:54 Images\Bear.jpg
文件 4242 2018-03-04 23:54 Images\Blank.jpg
文件 19201 2018-03-04 23:54 Images\Cure.jpg
文件 9151 2018-03-04 23:54 Images\Eagle.jpg
文件 18039 2018-03-04 23:54 Images\Elephant.jpg
文件 18429 2018-03-04 23:54 Images\EndArmy.jpg
文件 20473 2018-03-04 23:54 Images\EndGuards.jpg
文件 29472 2018-03-04 23:54 Images\EndPeople.jpg
文件 19793 2018-03-04 23:54 Images\EndProtest.jpg
文件 10561 2018-03-04 23:54 Images\EndSpeaker.jpg
文件 21733 2018-03-04 23:54 Images\LandCar.jpg
文件 9919 2018-03-04 23:54 Images\LandGuards.jpg
文件 19242 2018-03-04 23:54 Images\LandHunters.jpg
文件 19660 2018-03-04 23:54 Images\LandPoacher.jpg
文件 16992 2018-03-04 23:54 Images\LandRes.jpg
文件 21236 2018-03-04 23:54 Images\Lion.jpg
文件 12876 2018-03-04 23:54 Images\Lost.jpg
文件 20428 2018-03-04 23:54 Images\SeaFishing.jpg
文件 15893 2018-03-04 23:54 Images\SeaGuards.jpg
文件 17535 2018-03-04 23:54 Images\SeaShip.jpg
文件 10562 2018-03-04 23:54 Images\SeaSonar.jpg
文件 16103 2018-03-04 23:54 Images\SeaStaff.jpg
文件 18265 2018-03-04 23:54 Images\SkyCatcher.jpg
文件 21344 2018-03-04 23:54 Images\SkyKeeper.jpg
文件 22211 2018-03-04 23:54 Images\SkyKids.jpg
文件 15502 2018-03-04 23:54 Images\SkyKiller.jpg
文件 12136 2018-03-04 23:54 Images\SkyPlane.jpg
文件 505786 2018-03-04 23:54 Images\start.jpg
文件 15171 2018-03-04 23:54 Images\Tiger.jpg
............此处省略22个文件信息
相关资源
- JSP企业人事管理系统设计(源代码+论
- 当当网完整项目、包括js、css、html
- 三角网构TIN生成算法,Java语言实现
- java代码编写将excel数据导入到mysql数据
- Java写的cmm词法分析器源代码及javacc学
- JAVA JSP公司财务管理系统 源代码 论文
- JSP+MYSQL旅行社管理信息系统
- 推荐算法的JAVA实现
- 基于Java的酒店管理系统源码(毕业设
- java-图片识别 图片比较
- android毕业设计
- android-support-v4.jar已打包进去源代码
- java23种设计模式+23个实例demo
- java Socket发送/接受报文
- JAVA828436
- java界面美化 提供多套皮肤直接使用
- 在线聊天系统(java代码)
- 基于Java的图书管理系统807185
- java中实现将页面数据导入Excel中
- java 企业销售管理系统
- java做的聊天系统(包括正规课程设计
- Java编写的qq聊天室
- 商店商品管理系统 JAVA写的 有界面
- JAVA开发聊天室程序
- 在linux系统下用java执行系统命令实例
- java期末考试试题两套(答案) 选择(
- JAVA3D编程示例(建模、交互)
- Java 文件加密传输
- java做的房产管理系统
- 基于jsp的bbs论坛 非常详细
评论
共有 条评论