| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1567 人关注过本帖
标题:新人求助 想做一个RPG
只看楼主 加入收藏
一只小千亦
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2019-2-27
收藏
 问题点数:0 回复次数:2 
新人求助 想做一个RPG
萌新一枚
自己想做一个控制台RPG但有一些地方没有
突破,求大佬指点
代码如下
#include <iostream>
#include <cstdlib>
#include <string>
using namespace std;
int main()
{
    cout<<"欢迎使用本程序"<<endl;//瞎扯XD
    cout<<"加载中,请稍等"<<endl;
        int qian;
            int huihe;
                int bossxueliang;
                    int xiaoguaigongji;
                        int yongzhegongji;
                            int yongzhexueliang;
                                int yongzhefangyu;
                                    int shuaizi;
                                        qian=0;
                                            huihe=0;
                                                bossxueliang=10000;
                                                    xiaoguaigongji=10;
                                                        yongzhegongji=10;
                                                            yongzhexueliang=100;
                                                                yongzhefangyu=5;
    //设置属性                                                        
                                                                    cout<<"加载成功!"<<endl;
                                                                        cout<<"欢迎来到咸鱼斗恶龙的世界!"<<endl;
                                                                            cout<<"你作为勇者中的咸鱼,一心想要打败恶龙,于是你便踏上了这条路。"<<endl;                                                         
        int yongzhe;
        yongzhe=1;
        int xingdong;
        int xiaoguai;
        int goumai;
        while (bossxueliang>=0) {
            huihe=huihe++;
            if (yongzhe=1) {
                    system("pause");
                    cout<<"你去了商店"<<endl;
                    if (qian>=10) {
                    cout<<"你还有"<<qian<<"元"<<endl;
                    cout<<"你要买什么?"<<endl;
                    cout<<"2=护甲,3=剑,4=血量每个都是10元,输入1可以退出商店"<<endl;
                    cin>>goumai;
            }
                if (qian<10) {
                    cout<<"就这点钱?有了10元再来吧"<<endl;
                    cout<<"你还有"<<qian<<"元"<<endl;
                }
               
            
                    cout<<"血量"<<yongzhexueliang<<"防御"<<yongzhefangyu<<"攻击"<<yongzhegongji<<"boss血量"<<bossxueliang<<endl;
                    
               
                cout<<"要去打小怪吗"<<endl;
                cout<<"当然"<<endl;
                qian=qian+5;
                yongzhexueliang=yongzhexueliang-xiaoguaigongji+yongzhefangyu;
                bossxueliang=bossxueliang-yongzhegongji;
               
                }
               
                }
            
        
    system("pause");
      return 0;
}

目前是想完善商店(买护甲=yongzhefangyu++,买剑=yongzhegongji++,买血量=yongzhexueliang=100)和死亡后(yongzhexueluang=0)金钱归零和属性还原
但总会出现一下情况,麻烦大佬们帮忙
搜索更多相关主题的帖子: include int cout 欢迎 商店 
2019-02-28 20:41
一只小千亦
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2019-2-27
收藏
得分:0 
习惯用devc++了,用vc可能不习惯
2019-02-28 20:42
一只小千亦
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2019-2-27
收藏
得分:0 
好好自己解决了
2019-03-04 19:56
快速回复:新人求助 想做一个RPG
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017663 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved