当前位置:首页 » 操作系统 » rpg游戏源码

rpg游戏源码

发布时间: 2022-06-11 06:09:35

A. 请问哪里有android rpg游戏源码下载,最好是角色扮演类的!

诺泽尼亚3或者4很好玩

B. 求java rpg小游戏源代码 最好是文字rpg 不需要很复杂 只是交作业用

连连看的小源码

package Lianliankan;
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class lianliankan implements ActionListener
{
JFrame mainFrame; //主面板
Container thisContainer;
JPanel centerPanel,southPanel,northPanel; //子面板
JButton diamondsButton[][] = new JButton[6][5];//游戏按钮数组
JButton exitButton,resetButton,newlyButton; //退出,重列,重新开始按钮
JLabel fractionLable=new JLabel("0"); //分数标签
JButton firstButton,secondButton; //分别记录两次被选中的按钮
int grid[][] = new int[8][7];//储存游戏按钮位置
static boolean pressInformation=false; //判断是否有按钮被选中
int x0=0,y0=0,x=0,y=0,fristMsg=0,secondMsg=0,validateLV; //游戏按钮的位置坐标
int i,j,k,n;//消除方法控制
public void init(){
mainFrame=new JFrame("JKJ连连看");
thisContainer = mainFrame.getContentPane();
thisContainer.setLayout(new BorderLayout());
centerPanel=new JPanel();
southPanel=new JPanel();
northPanel=new JPanel();
thisContainer.add(centerPanel,"Center");
thisContainer.add(southPanel,"South");
thisContainer.add(northPanel,"North");
centerPanel.setLayout(new GridLayout(6,5));
for(int cols = 0;cols < 6;cols++){
for(int rows = 0;rows < 5;rows++ ){
diamondsButton[cols][rows]=new JButton(String.valueOf(grid[cols+1][rows+1]));
diamondsButton[cols][rows].addActionListener(this);
centerPanel.add(diamondsButton[cols][rows]);
}
}
exitButton=new JButton("退出");
exitButton.addActionListener(this);
resetButton=new JButton("重列");
resetButton.addActionListener(this);
newlyButton=new JButton("再来一局");
newlyButton.addActionListener(this);
southPanel.add(exitButton);
southPanel.add(resetButton);
southPanel.add(newlyButton);
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())));
northPanel.add(fractionLable);
mainFrame.setBounds(280,100,500,450);
mainFrame.setVisible(true);
}
public void randomBuild() {
int randoms,cols,rows;
for(int twins=1;twins<=15;twins++) {
randoms=(int)(Math.random()*25+1);
for(int alike=1;alike<=2;alike++) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=randoms;
}
}
}
public void fraction(){
fractionLable.setText(String.valueOf(Integer.parseInt(fractionLable.getText())+100));
}
public void reload() {
int save[] = new int[30];
int n=0,cols,rows;
int grid[][]= new int[8][7];
for(int i=0;i<=6;i++) {
for(int j=0;j<=5;j++) {
if(this.grid[i][j]!=0) {
save[n]=this.grid[i][j];
n++;
}
}
}
n=n-1;
this.grid=grid;
while(n>=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
while(grid[cols][rows]!=0) {
cols=(int)(Math.random()*6+1);
rows=(int)(Math.random()*5+1);
}
this.grid[cols][rows]=save[n];
n--;
}
mainFrame.setVisible(false);
pressInformation=false; //这里一定要将按钮点击信息归为初始
init();
for(int i = 0;i < 6;i++){
for(int j = 0;j < 5;j++ ){
if(grid[i+1][j+1]==0)
diamondsButton[i][j].setVisible(false);
}
}
}
public void estimateEven(int placeX,int placeY,JButton bz) {
if(pressInformation==false) {
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
pressInformation=true;
}
else {
x0=x;
y0=y;
fristMsg=secondMsg;
firstButton=secondButton;
x=placeX;
y=placeY;
secondMsg=grid[x][y];
secondButton=bz;
if(fristMsg==secondMsg && secondButton!=firstButton){
xiao();
}
}
}
public void xiao() { //相同的情况下能不能消去。仔细分析,不一条条注释
if((x0==x &&(y0==y+1||y0==y-1)) || ((x0==x+1||x0==x-1)&&(y0==y))){ //判断是否相邻
remove();
}
else{
for (j=0;j<7;j++ ) {
if (grid[x0][j]==0){ //判断第一个按钮同行哪个按钮为空
if (y>j) { //如果第二个按钮的Y坐标大于空按钮的Y坐标说明第一按钮在第二按钮左边
for (i=y-1;i>=j;i-- ){ //判断第二按钮左侧直到第一按钮中间有没有按钮
if (grid[x][i]!=0) {
k=0;
break;
}
else{ k=1; } //K=1说明通过了第一次验证
}
if (k==1) {
linePassOne();
}
}
if (y<j){ //如果第二个按钮的Y坐标小于空按钮的Y坐标说明第一按钮在第二按钮右边
for (i=y+1;i<=j ;i++ ){ //判断第二按钮左侧直到第一按钮中间有没有按钮
if (grid[x][i]!=0){
k=0;
break;
}
else { k=1; }
}
if (k==1){
linePassOne();
}
}
if (y==j ) {
linePassOne();
}
}
if (k==2) {
if (x0==x) {
remove();
}
if (x0<x) {
for (n=x0;n<=x-1;n++ ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 && n==x-1) {
remove();
}
}
}
if (x0>x) {
for (n=x0;n>=x+1 ;n-- ) {
if (grid[n][j]!=0) {
k=0;
break;
}
if(grid[n][j]==0 && n==x+1) {
remove();
}
}
}
}
}
for (i=0;i<8;i++ ) { //列
if (grid[i][y0]==0) {
if (x>i) {
for (j=x-1;j>=i ;j-- ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else { k=1; }
}
if (k==1) {
rowPassOne();
}
}
if (x<i) {
for (j=x+1;j<=i;j++ ) {
if (grid[j][y]!=0) {
k=0;
break;
}
else { k=1; }
}
if (k==1) {
rowPassOne();
}
}
if (x==i) {
rowPassOne();
}
}
if (k==2){
if (y0==y) {
remove();
}
if (y0<y) {
for (n=y0;n<=y-1 ;n++ ) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 && n==y-1) {
remove();
}
}
}
if (y0>y) {
for (n=y0;n>=y+1 ;n--) {
if (grid[i][n]!=0) {
k=0;
break;
}
if(grid[i][n]==0 && n==y+1) {
remove();
}
}
}
}
}
}
}
public void linePassOne(){
if (y0>j){ //第一按钮同行空按钮在左边
for (i=y0-1;i>=j ;i-- ){ //判断第一按钮同左侧空按钮之间有没按钮
if (grid[x0][i]!=0) {
k=0;
break;
}
else { k=2; } //K=2说明通过了第二次验证
}
}
if (y0<j){ //第一按钮同行空按钮在与第二按钮之间
for (i=y0+1;i<=j ;i++){
if (grid[x0][i]!=0) {
k=0;
break;
}
else{ k=2; }
}
}
}
public void rowPassOne(){
if (x0>i) {
for (j=x0-1;j>=i ;j-- ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else { k=2; }
}
}
if (x0<i) {
for (j=x0+1;j<=i ;j++ ) {
if (grid[j][y0]!=0) {
k=0;
break;
}
else { k=2; }
}
}
}
public void remove(){
firstButton.setVisible(false);
secondButton.setVisible(false);
fraction();
pressInformation=false;
k=0;
grid[x0][y0]=0;
grid[x][y]=0;
}
public void actionPerformed(ActionEvent e) {
if(e.getSource()==newlyButton){
int grid[][] = new int[8][7];
this.grid = grid;
randomBuild();
mainFrame.setVisible(false);
pressInformation=false;
init();
}
if(e.getSource()==exitButton)
System.exit(0);
if(e.getSource()==resetButton)
reload();
for(int cols = 0;cols < 6;cols++){
for(int rows = 0;rows < 5;rows++ ){
if(e.getSource()==diamondsButton[cols][rows])
estimateEven(cols+1,rows+1,diamondsButton[cols][rows]);
}
}
}
public static void main(String[] args) {
lianliankan llk = new lianliankan();
llk.randomBuild();
llk.init();
}
}

//old 998 lines
//new 318 lines

C. 请问下载到的rpg游戏C++源码怎么使用

要看你下载的游戏是用什么结构开发的了。如果缺少的是d开头的头文件,一般是用DirectX框架开发的游戏。目前大部分的C++ rpg都是用这个开发的。比如ddraw,dmusic这样的头文件,都是属于directx的。如果你缺少的是这些的话,去下载DirectX_SDK_library_include,一般一些提供源码资源的网站会有,下载回来的压缩包中会有许多.h文件和lib文件。把这些文件解压出来,分别复制到你的VC目录下的Lib和include文件夹中。这时候再编译你的游戏dsw工程文件,应该就可以了。
另外,VS2008中会缺少一些VC6有的library和.h文件,如果你要在VS下运行,就需要从VC6的include和library中找到并复制到VS的相应目录下。个人认为你可以把所有的VC6的这些文件移动过去,以防止以后不时出现的问题。
如果你的头文件都没有包含在里面,可能用到了其他开发框架,建议你用头文件的名字搜索一下,下载到头文件包含到VC或VS的安装目录中去。
希望能帮到你。

D. 如何知道一个RPG游戏的游戏代码,例如游戏的物品代码等那些

下一个金山游侠,打开游戏,记下一个数字,比如金钱,(1234文)搜1234,记下代码,如果有好几个,再登一次游戏,花掉一些钱,或者赚一些,(4321文)再搜,找和第一次同名的,物品什么一样

E. 跪求RGP游戏编程代码(最好用c#编的)

偶曾写过一个泡泡堂的不过不能算rpg的吧,rpg的估计没有人给你吧,想看的话可以到我的空间里下载

F. 山寨传奇RPG易语言源码

8.1版本,下载地址

G. 求rpg maker xp游戏源码

1234来鹏鸟……你太无耻了吧……

H. 求一个flash制作的rpg游戏源代码

需要使用以下软件:

功能不须多说,功能完备,不仅能制作FLASH动画片与游戏,还支持AS动态脚本..

免费下载:
http://hi..com/msoffice2003p/blog/item/4a51ee938f7dccabc9eaf4b7.html

安全无毒,安装完成即可永久使用
支持32位和64位的WINDOWS7、 XP、WIN2000、WIN2003等

I. 求一个简单RPG游戏的代码,JAva编写的

packagecom.lxi;

importjava.io.BufferedReader;
importjava.io.InputStreamReader;

publicclassRpg{
@SuppressWarnings("unchecked")
publicstaticvoidmain(String[]args)throwsException{
System.out.println("在这里输入两个人物进行PK,以英文逗号分隔:[BM,DH,MK]");
BufferedReaderbr=newBufferedReader(newInputStreamReader(System.in));
Class<Person>c1;
Class<Person>c2;
try{
Stringtemp=br.readLine();
String[]str=temp.split(",");
if(str.length!=2){
thrownewException("输入格式有误,按默认PK");
}
c1=(Class<Person>)Class.forName("com.lxi."
+str[0].toUpperCase());
c2=(Class<Person>)Class.forName("com.lxi."
+str[1].toUpperCase());
}catch(Exceptione){
//TODOAuto-generatedcatchblock
c1=(Class<Person>)Class.forName("com.lxi.BM");
c2=(Class<Person>)Class.forName("com.lxi.DH");
}
try{
Personp1=c1.newInstance();
Personp2=c2.newInstance();
longtime=System.currentTimeMillis();
longnextTime1=(long)(time+p1.coldTime*1000);//
longnextTime2=(long)(time+p2.coldTime*1000);//发动攻击的时间
System.out.println("---游戏开始---");
while(true){
longcurrenTime=System.currentTimeMillis();

if(nextTime1<currenTime){//时间到则发动攻击
p1.hit(p2);
nextTime1+=p1.coldTime*1000+p1.waitTime*1000;//下次攻击时间=冷却时间+被晕眩时间
p1.waitTime=0;//回合结束,重置被晕眩时间为0
}
if(nextTime2<currenTime){
p2.hit(p1);
nextTime2+=p2.coldTime*1000+p2.waitTime*1000;
p2.waitTime=0;
}
}
}catch(ClassCastExceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}catch(InstantiationExceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}catch(IllegalAccessExceptione){
//TODOAuto-generatedcatchblock
e.printStackTrace();
}catch(Exceptione){
e.printStackTrace();
}
}
}




packagecom.lxi;

importjava.util.Random;

classBMextendsPerson{
publicBM(){
val=650;
coldTime=1.5;
fight=40;
chanceHit=3;
chanceDefense=3;
waitTime=0;
}

intcount=0;//防御技能发动的次数
inttemp=40;//攻击力,值同fight
booleanhitFlag=false;
booleandefenseFlag=false;
Randomrand=newRandom();

publicvoidhit(Personp){
if(rand.nextInt(10)<chanceHit){
fight=fight*2;//发动双倍攻击
hitFlag=true;
}
inthurt=p.defense(this);
p.val=p.val-hurt;
fight=temp;//还原为单倍攻击
if(p.val<=0){
System.out.println(this.getClass().getSimpleName()+"胜出!");
System.exit(0);
}
System.out.println(this.getClass().getSimpleName()+"攻击"
+p.getClass().getSimpleName()+","
+this.getClass().getSimpleName()
+(this.hitFlag?"发动攻击技能":"未发动攻击技能")
+p.getClass().getSimpleName()
+(this.defenseFlag?"发动防御技能":"未发动防御技能")
+this.getClass().getSimpleName()+":"+this.val+","
+p.getClass().getSimpleName()+":"+p.val);
hitFlag=false;
defenseFlag=false;
}

publicintdefense(Personp){
if(rand.nextInt(10)<chanceDefense){
if(count!=0){
p.val=p.val-p.fight;
count++;
defenseFlag=true;
if(p.val<=0){
System.out.println(this.getClass().getSimpleName()+"胜出!");
System.exit(0);
}
}
}
returnp.fight;
}
}

classMKextendsPerson{
publicMK(){
val=700;
coldTime=2.5;
fight=50;
chanceDefense=6;
chanceHit=3;
waitTime=0;
}

booleanhitFlag=false;
booleandefenseFlag=false;
Randomrand=newRandom();

publicvoidhit(Personp){
if(rand.nextInt(10)<chanceHit){
p.waitTime=3;//使对方晕眩3s
hitFlag=true;
}
inthurt=p.defense(this);
p.val=p.val-hurt;
if(p.val<=0){
System.out.println(this.getClass().getSimpleName()+"胜出!");
System.exit(0);
}
System.out.println(this.getClass().getSimpleName()+"攻击"
+p.getClass().getSimpleName()+","
+this.getClass().getSimpleName()
+(this.hitFlag?"发动攻击技能":"未发动攻击技能")
+p.getClass().getSimpleName()
+(this.defenseFlag?"发动防御技能":"未发动防御技能")
+this.getClass().getSimpleName()+":"+this.val+","
+p.getClass().getSimpleName()+":"+p.val);
hitFlag=false;
defenseFlag=false;
}

publicintdefense(Personp){
if(rand.nextInt(10)<chanceDefense){
defenseFlag=true;
returnp.fight/2;//防御技能发动,伤害减半
}
returnp.fight;
}
}


packagecom.lxi;

importjava.io.BufferedReader;
importjava.io.InputStreamReader;
importjava.util.Random;

//三个人物的基类
abstractclassPerson{
intval;//生命值
doublecoldTime;//冷却时间
intwaitTime;//晕眩时间
intfight;//攻击力
intchanceHit;//发起主动技能的概率
intchanceDefense;//发起防御技能的概率

abstractvoidhit(Personp);//攻击技能

abstractintdefense(Personp);//防御技能,返回被伤害点数
}

classDHextendsPerson{
publicDH(){
val=600;
coldTime=1.0;
fight=30;
chanceHit=3;//表示30%的概率
chanceDefense=3;
waitTime=0;
}

Randomrand=newRandom();
booleanhitFlag=false;//主动技能发动的标识
booleandefenseFlag=false;//防御技能发动的标识

publicvoidhit(Personp){
if(rand.nextInt(10)<chanceHit){//发动主动技能
inthurt=p.defense(this);
p.val=p.val-hurt;
if(p.val<=0){
System.out.println(this.getClass().getSimpleName()+"胜出!");
System.exit(0);
}
val=val+hurt;
if(val>600)
val=600;
hitFlag=true;//标记主动技能已经发动
}else{//进行普通攻击
inthurt=p.defense(this);
p.val=p.val-hurt;
if(p.val<=0){
System.out.println(this.getClass().getSimpleName()+"胜出!");
System.exit(0);
}
}
System.out.println(this.getClass().getSimpleName()+"攻击"
+p.getClass().getSimpleName()+","
+this.getClass().getSimpleName()
+(this.hitFlag?"发动攻击技能":"未发动攻击技能")
+p.getClass().getSimpleName()
+(this.defenseFlag?"发动防御技能":"未发动防御技能")
+this.getClass().getSimpleName()+":"+this.val+","
+p.getClass().getSimpleName()+":"+p.val);
hitFlag=false;//
defenseFlag=false;//重置标记,下次重用
}

publicintdefense(Personp){
if(rand.nextInt(10)<chanceDefense){
defenseFlag=true;//标记防御技能已经发动
return0;
}else{
returnp.fight;
}
}
}

J. 谁有Flash RPG 小游戏的游戏制作源码

魔力宝贝单机版

热点内容
wincc图形编译在哪里 发布:2024-09-17 03:58:26 浏览:977
androidubuntu 发布:2024-09-17 03:50:27 浏览:701
识梦源码 发布:2024-09-17 03:50:18 浏览:26
诺基亚密码忘了打什么电话 发布:2024-09-17 03:27:09 浏览:555
树深度优先算法 发布:2024-09-17 03:26:58 浏览:472
跳转页源码 发布:2024-09-17 03:13:05 浏览:543
html文件上传表单 发布:2024-09-17 03:08:02 浏览:785
聊天软件编程 发布:2024-09-17 03:00:07 浏览:726
linuxoracle安装路径 发布:2024-09-17 01:57:29 浏览:688
两个安卓手机照片怎么同步 发布:2024-09-17 01:51:53 浏览:207