游戏开发日志1
2025-12-06 22:09:34
发布于:香港
游戏名称:The Newbie's Journey Log
版本:1.0
我的DEV-C++只支持繁体字,无奈只能用English
代码:李伙子ia
美术:也没美术啊
翻译:Artificial Intelligence
#include<iostream>
#include<string>
#include<windows.h>
using namespace std;
struct player{
string name="s001";
int money=0;
int health=100,attack=5,defense=0;
double damage=0.0;
};
void coutime(string out,DWORD tIm){
for(int i=0,len=out.size();i<len;i++){
cout<<out[i];
Sleep(tIm);
}
}
int main(){
player s001;
string choice;
cout<<"The Newbie's Journey Log"<<endl;
cout<<"Version:1.0"<<endl;
Sleep(1000);
coutime("What is your name?\n",100);
cout<<"Your answer:";
getline(cin,s001.name);
coutime("Hello "+s001.name+"!I am village cheif of novice village.\nI'll help your to start the 'game'.\n",100);
cout<<"A: I what to know the 'basic game rule'.\nPlease choose your choice:";
cin>>choice;
coutime("You can input these things to do some operate,\n",100);
Sleep(500);
cout<<"Input money:Look over your money amount"<<endl;
cout<<"Input fitness:Look over your health, attack, defense, and damage"<<endl;
cout<<"Input start:Start the 'game'!"<<endl;
Sleep(500);
cout<<"A: OK!\nPlease choose your choice:";
cin>>choice;
coutime("Goodbye!",100);
system("cls");
while(1){
cout<<"The Newbie's Journey Log"<<endl;
cout<<"Version:1.0"<<endl;
cout<<"Input money:Look over your money amount"<<endl;
cout<<"Input fitness:Look over your health, attack, defense, and damage"<<endl;
cout<<"Input start:Start the 'game'!"<<endl;
cout<<"Please start your operate:";
cin>>choice;
if(choice=="money"){
cout<<"Your money amount:"<<s001.money<<endl;
cout<<"Input E to continue...";
char key;
cin>>key;
if(key=='E'){
system("cls");
continue;
}
}else if(choice=="fitness"){
cout<<"Your health, attack, defense, and damage:"<<s001.health<<", "<<s001.attack<<", "<<s001.defense<<", "<<s001.damage<<endl;
cout<<"Input E to continue...";
char key;
cin>>key;
if(key=='E'){
system("cls");
continue;
}
}else if(choice=="start"){
cout<<"C means completed level, and U means uncompleted level."<<endl;
cout<<"Newbie's Guide: ";
cout<<"1-1"<<endl;
cout<<"Please choose a level(x-y):";
int x,y;
cin>>x>>y;
if(x>1||y>1){
cout<<"This mode is only available in version ???"<<endl;
cout<<"Input E to continue...";
char key;
cin>>key;
if(key=='E'){
system("cls");
continue;
}
}else{
if(x==1){
if(y==1){
int HP=s001.health;
cout<<"Monster: ";
coutime("Hehehe!With me here, you're not getting past.\n",100);
cout<<s001.name+": ";
coutime("Damn!\n",100);
cout<<"Monster: ";
coutime("Unless you can beat me.\n",100);
cout<<s001.name+": ";
coutime("Come on!\n",100);
player m={"Monster 1-1",2,10,2,0,0.0};
while(1){
cout<<"Your fitness: "<<s001.health<<", "<<s001.attack<<", "<<s001.defense<<", "<<s001.damage<<endl;
cout<<"Monster fitness: "<<m.health<<", "<<m.attack<<", "<<m.defense<<", "<<m.damage<<endl;
cout<<"A: Attack("<<s001.attack<<")"<<endl;
cout<<"Please choose your choice:";
cin>>choice;
cout<<"Monster's health -"<<s001.attack<<endl;
m.health-=s001.attack;
cout<<"Monster attack you. Your's health -"<<m.attack<<endl;
s001.health-=m.attack;
if(m.health<=0){
cout<<"Monster: ";
coutime("Oh!You win!",100);
cout<<"Monster dead.You award some money(money +"<<m.money<<")."<<endl;
s001.money+=m.money;
s001.health=HP;
break;
}
}
cout<<"Input E to continue...";
char key;
cin>>key;
if(key=='E'){
system("cls");
continue;
}
}
}
}
}else{
cout<<"The function can't be found!"<<endl;
cout<<"Input E to continue...";
char key;
cin>>key;
if(key=='E'){
system("cls");
continue;
}
}
}
}
应该只支持DEV-C++
记得点个赞
全部评论 2
6天前 来自 香港
0我和“新手团”的小伙伴都在ACGO等你,快用这个专属链接加入我们吧!https://www.acgo.cn/application/195195369566370201
1周前 来自 香港
0








有帮助,赞一个