新人求助 想做一个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)金钱归零和属性还原
但总会出现一下情况,麻烦大佬们帮忙