2
已解决
周琪岳
资深光能
资深光能
控制台游戏社(社长周琪岳)正式开始编写剧情游戏 银河传奇1:文明危机,预计2021年3-5月第一代正式版即可亮相,先爆个照!
(本游戏不含任何侮辱,关机代码等,并且是一个剧情游戏,纯原创,不是从课设讲义里粘贴的那种)
#include <windows.h>
#include <conio.h>
#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;
#define qdo 262 //背景音乐
#define qre 294
#define qmi 330
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
bool flag=true;//重要变量常量定义
string name;
long long jin=200,zuan=120;
bool m_lock[10]={0,1,1,0,0,0,0,0,0,0};//主菜单的选项锁
long long ju=1;
bool g_lock[11]={0,1,0,0,0,0,0,0,0,0,0};
bool ju_lock[1100]={0,1};
void Game();//函数声明
void story_begin();
void name_1();
void menu();
char gamestart();
void zhuye();
void jq_zhu();
//武器定义
//舰船库
string name_ship[71]={
"",
"3BCII-1代激光打击舰",
"水母965-1代舰",
"维克多QR初级电波舰",
"3BCII-1代激光打击舰-电场外挂版",
"3BCII-1代激光打击舰-放射外挂版",
"3BCII-1代激光打击舰-911外挂版",
"新亚细亚警戒者-1代",
"3BCII-2代激光打击舰",
"水母965-2代舰",
"水母965-2代舰-911外挂版",
"天凤之吼X-1代电磁盾驱逐舰",
"3BCII-3代激光打击舰",
"水母965-2代舰-放射外挂版",
"新亚细亚警戒者-1代-电场外挂版",
"天凤之吼X-1代电磁盾驱逐舰-放射外挂版",
"天凤之吼X-1代电磁盾驱逐舰-911外挂版",
"天凤之吼X-2代电磁盾驱逐舰",
"水母965-3代舰",
"新亚细亚警戒者-1代-放射外挂版",
"新亚细亚警戒者-2代",
"欧罗巴探索者-1代",
"欧罗巴探索者-1代-电场外挂版",
"水母965-3代舰-911外挂版",
"天凤之吼X-3代电磁盾驱逐舰",
"天凤之吼X-3代电磁盾驱逐舰-放射外挂版",
"欧罗巴探索者-1代-放射外挂版",
"欧罗巴探索者-1代-911外挂版",
"新亚细亚警戒者-2代-放射外挂版",
"新亚细亚警戒者-2代-911外挂版",
"新亚细亚警戒者-3代",
"ALSK特级骨干护卫舰",
"BE-IPUL联合一号-1代",
"欧罗巴探索者-1代-911外挂版-ALSK护卫套装",
"欧罗巴探索者-2代",
"BE-IPUL联合一号-1代-电场外挂版",
"BE-IPUL联合一号-1代-放射外挂版",
"BE-IPUL联合一号-1代-911外挂版",
"星论一夕号光速飞船(基础)-1代",
"欧罗巴探索者-2代-电场外挂版",
"欧罗巴探索者-2代-放射外挂版",
"欧罗巴探索者-2代-911外挂版",
"星论一夕号光速飞船(基础)-1代-电场外挂版",
"星论一夕号光速飞船(基础)-1代-放射外挂版",
"欧罗巴探索者-2代-981外挂版",
"BE-IPUL联合一号-1代-911外挂版-ALSK护卫套装",
"欧罗巴探索者-2代-911外挂版-ALSK护卫套装",
"欧罗巴探索者-2代-981外挂版-ALSK护卫套装",
"BE-IPUL联合一号-2代",
"欧罗巴探索者-3代",
"星论一夕号光速飞船(基础)-1代-911外挂版",
"星论一夕号光速飞船(基础)-1代-981外挂版",
"星论一夕号光速飞船(基础)-1代-911外挂版-ALSK护卫套装",
"星论一夕号光速飞船(基础)-1代-981外挂版-ALSK护卫套装",
"星论一夕号光速飞船(基础)-2代",
"BE-IPUL联合一号-3代",
"星论一夕号光速飞船(基础)-3代",
};
long long ship_xue[71]={
0,
10,
11,
12,
12,
13,
14,
14,
14,
15,
16,
17,
23,
29,
48,
98,
130,
450,
451,
1026,
1427,
2421,
2657,
3424,
3568,
3741,
3909,
5081,
6798,
9909,
9999,
10231,
12875,
67897,
26482,
37642,
91284,
286075,
3087881,
100000000,
986299999,
998799999,
999999999,
1029377138,
73948715438,
8753122456541,
32514656255743,
42645147356237,
74654267862767,
81818181818181,
82828282828282,
93939393939393,
94949494949494,
97979797979797,
98989898989898,
99999999999999999,
};
long long ship_wu[71]={
0,
2,
3,
3,
4,
4,
4,
5,
5,
5,
5,
5,
6,
7,
8,
10,
20,
67,
68,
70,
275,
356,
356,
424,
568,
841,
1000,
1400,
1450,
1475,
1836,
1857,
1909,
2013,
3048,
5069,
9876,
209873,
187881,
9100000,
96289990,
187704391,
99999999,
829377138,
13948715438,
953122456541,
2514656255743,
9645146656237,
24654267862767,
1818181818181,
12828282828282,
93939393939393,
14949494949494,
17979797979797,
18989898989898,
9999999999999999,
};
int main(){
Game();
return 0;
}
void Game(){
char t=gamestart();
switch (t){
case 'a':menu();
case 'Z':
system("cls");
cout<<"Bilud2020_1(开发版公测)-Dev\n";
system("pause");
Game();
default:break;
}
}
void name_1(){
cout<<"请你给自己起一个名字(不超过10个字符)\n ";
getline(cin,name);
if(name.size()>10){
cout<<"格式不正确,请重新输入!";
system("pause");
system("cls");
name_1();
}
system("cls");
}
void story_begin(){
system("cls");
cout<<"2057年,一个名叫“光聚者”的神秘科学家发现了一颗流星经过地球时撒落的碎片,\n";
Beep(qso,400);
Sleep(3000);
cout<<"经过我们日日夜夜的研究,\n";
Beep(qso,400);
Sleep(3000);
cout<<"我们发现,那块碎片上有着大量的外星科技信息!而那颗流星就是——\n";
Beep(qso,400);
Sleep(3000);
cout<<"银河深处,一个神秘文明文明的星际战舰!\n";
Beep(qso,400);
Sleep(3000);
cout<<"而这时,“光聚者”却失踪了……\n";
Beep(qso,400);
Sleep(3000);
cout<<"由于碎片的帮助,我们人类文明成功的拥有了许多奇迹般的科技,\n";
Beep(qso,400);
Sleep(3000);
cout<<"包括戴森球、制造虫洞星门,甚至是光速飞船,\n";
Beep(qso,400);
Sleep(3000);
cout<<"我们主宰了几乎整个猎户座悬臂,将其他文明统统击败,\n";
Beep(qso,400);
Sleep(3000);
cout<<"我们曾一度认为,整个银河,我们已所向披靡!\n";
Beep(qso,400);
Sleep(3000);
cout<<"直到2508年,那个给予我们强大力量的神秘文明突然来到,\n";
Beep(qso,400);
Sleep(3000);
cout<<"他将我们最精锐、最自豪的“迅剑光星”联合星际战队打的片甲不留,\n";
Beep(qso,400);
Sleep(3000);
cout<<"随后又消失不见……\n";
Beep(qso,400);
Sleep(3000);
cout<<"他们为什么要这样做?他们又为什么离去?\n";
Beep(qso,400);
Sleep(3000);
cout<<"人们暂且放下悲痛与疑虑,\n";
Beep(qso,400);
Sleep(3000);
cout<<"向着银河深处进发……\n";
Beep(qso,400);
Sleep(3000);
cout<<"而你知道,\n";
Beep(qso,400);
Sleep(3000);
cout<<"只有找到“光聚者”,才有可能拯救人类文明,重建新的辉煌!\n";
Beep(qso,400);
Sleep(3500);
system("pause");
system("cls");
}
void menu(){
if(flag=true){
flag=false;
story_begin();
}
name_1();
zhuye();
}
char gamestart(){
system("cls");
cout<<"\n\n\n\n\n 欢迎来到银河传奇1:文明危机\n";
cout<<"\n\n\n\n\n\n\n\n\n\n QiyueZhou游戏工作室出品\n";
Sleep(1500);
cout<<"\n 按下a键进入游戏";
cout<<"\n 按下Z键查看版本号";
char c=getch();
Beep(do,200);
Beep(re,200);
Beep(mi,200);
Sleep(800);
Beep(mi,200);
Beep(re,200);
Beep(do,200);
return c;
}
void zhuye(){
system("cls");
Beep(qdo,400);
cout<<"\n\n\n";
cout<<name<<"——点P查看属性\n";
cout<<"我的金币:"<<jin<<"\n";
cout<<"我的钻石:"<<zuan<<"\n";
cout<<"点1查看主剧情\n";
cout<<"点2查看支线剧情\n";
cout<<"点3查看宇联公会\n";
cout<<"点4查看太空特别事务处\n";
cout<<"点5进查看银河星图\n";
cout<<"点6进入星际研习\n";
cout<<"点7进入银河商城\n";
cout<<"点8进入神秘星际店\n";
cout<<"点9进入银河特工队\n";
cout<<"点0退出游戏\n";
cout<<"----";
char c1=getch();
Beep(mi,250);
if(!m_lock[(int)c1-48]){
Beep(so,300);
Beep(fa,300);
Beep(mi,300);
Beep(re,300);
Beep(do,300);
Sleep(475);
cout<<"继续游玩以解锁\n";
Sleep(680);
system("cause");
zhuye();
}
switch (c1){
case '1': jq_zhu();
}
}
void jq_zhu(){
system("cls");
}
周琪岳在2020-11-17 20:26:56追加了内容
希望各位大佬给出建议,最优者将获得50酷町币(裤裆毙)的奖励,并且获得我的关注
周琪岳在2020-11-17 20:28:25追加了内容
KUDANGBI
周琪岳在2020-11-18 21:29:42追加了内容
我顶
0
0
0
沙宸安
高级启示者
高级启示者
您这边没生意的原因主要还是这两个帖子
您的代码还是很不错的了
另外,我能借鉴一下您的:
#define qdo 262 //背景音乐
#define qre 294
#define qmi 330
#define qfa 349
#define qso 392
#define qla 440
#define qsi 494
#define do 523
#define re 578
#define mi 659
#define fa 698
#define so 784
#define la 880
#define si 988
#define do1 1046
#define re1 1175
#define mi1 1318
#define fa1 1480
#define so1 1568
#define la1 1760
#define si1 1976
#define sqdo 277
#define sqre 311
#define sqfa 370
#define sqso 415
#define sqla 466
#define sdo 554
#define sre 622
#define sfa 740
#define sso 831
#define sla 932
#define sdo1 1046
#define sre1 1245
#define sfa1 1480
#define sso1 1661
#define sla1 1865
吗?我后期开发XA制作音乐播放器可能会用。
0
0
0
0
0