0
已解决
包涵宇
中级天翼
中级天翼
进展:
1、彩蛋部分完工,代码公式如下:
void slowlyout_red(string s){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
for(int i=0;i<s.size();i++){
cout<<s[i];
Sleep(60);
}
cout<<"\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
}
void print_cai1_1(){
/*
---
/ \
/ ︵ ︵ \
| |
\ /
\ ︶ /
---
*/
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" ---\n / \\\n / ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"︵ ︵";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" \\\n| | \n \\ /\n \\ ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"︶";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" /\n ---\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"--------------------------------------------------\n";
}
void print_cai1_2(){
/*
---
/ \
/ -- -- \
| |
\ /
\ ︶ /
---
*/
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" ---\n / \\\n / ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"-- --";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" \\\n| | \n \\ /\n \\ ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"︶";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" /\n ---\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"--------------------------------------------------\n";
}
void print_cai1_3(){
/*
---
/ \
/ ﹃ ﹃ \
| |
\ /
\ ︶ /
---
*/
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" ---\n / \\\n / ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"﹃ ﹃";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" \\\n| | \n \\ /\n \\ ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"︶";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<" /\n ---\n";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"--------------------------------------------------\n";
}
int mp[9][18]={
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ,//this line just use simple output
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0} ,//this line just use simple output
{0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0} ,
{0,0,2,0,0,3,0,0,0,0,0,2,0,0,3,0,0,0} ,
{0,0,0,2,0,0,3,0,0,0,0,2,0,3,0,0,0,0} ,
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} ,
{1,0,0,0,4,0,0,0,0,0,0,0,0,0,6,0,0,0} ,
{1,0,0,0,0,0,0,0,5,0,0,0,0,0,0,0,0,0} ,
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1} ,
};
int tmp_cai2=0;
void print_cai2(int x,int y){
if(tmp_cai2==1){
tmp_cai2=0;
system("cls");
}
/* line 1 */
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"□□";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);//蓝色
cout<<"■■■■■■■■■■■■■■";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"□□\n";
/* line 2 */
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"□□";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);//蓝色
cout<<"■";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
cout<<" Welcome To WJRvillage! ";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);//蓝色
cout<<"■";
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"□□\n";
/* main */
for(int i=2;i<9;i++){
for(int j=0;j<18;j++){
int t_mp=mp[i][j];
if(i==x&&j==y){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
cout<<"△";
}
else if(t_mp==0){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
cout<<"□";
}
else if(t_mp==1){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);//蓝色
cout<<"■";
}
else if(t_mp==2){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN |FOREGROUND_BLUE);//青色
cout<<"×";
}
else if(t_mp==3){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN);//绿色
cout<<"※";
}
else if(t_mp==4){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
cout<<"○";
}
else if(t_mp==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
cout<<"△";
}
else if(t_mp==6){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
cout<<"☆";
}
}
cout<<"\n";
}
/*
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED);//红色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN);//绿色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_BLUE);//蓝色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN);//**
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_BLUE);//粉色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_GREEN |FOREGROUND_BLUE);//青色
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY);//原色
*/
}
void cai2(){
/*
□□■■■■■■■■■■■■■■□□
□□■ Welcome To WJRvillage! ■□□
□□■■■■■■■■■■■■■■□□
□□×□□※□□□□□×□□※□□□
□□□×□□※□□□□×□※□□□□
■■■■■■■■■■■■■■■■■■
■□□□○□□□□□□□□□☆□□□
■□□□□□□□△□□□□□□□□□
■■■■■■■■■■■■■■■■■■
6,4
7,8
6,14
begin:7,1
□0 none
■1 blue
×2 light green
※3 green
○4 △5 ☆6 red
you:△ gold
*/
int x=7,y=1;
print_cai2(x,y);
while(y!=17){
/*
VK_LEFT 左箭头键 0x25
VK_UP 上箭头键 0x26
VK_RIGHT 右箭头键 0x27
VK_DOWN 下箭头键 0x28
*/
if(get(0x25)){
if(mp[x][y-1]==0){
y--;
cls();
print_cai2(x,y);
Sleep(150);
}
}
if(get(0x26)){
if(mp[x-1][y]==0){
x--;
cls();
print_cai2(x,y);
Sleep(150);
}
}
if(get(0x27)){
if(mp[x][y+1]==0){
y++;
cls();
print_cai2(x,y);
Sleep(150);
}
}
if(get(0x28)){
if(mp[x+1][y]==0){
x++;
cls();
print_cai2(x,y);
Sleep(150);
}
}
if(get(0x5A)){
if(tmp_cai2==1){
system("cls");
print_cai2(x,y);
}
if(x==6&&y==3||x==7&&y==3||x==7&&y==4||x==7&&y==5||x==6&&y==5){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"------------------------------------\n";
cout<<"*瞎哈哈!欢迎来到WJRvillage!";
tmp_cai2=1;
Sleep(200);
}
if(x==7&&y==7||x==6&&y==7||x==6&&y==8||x==6&&y==9||x==7&&y==9){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"------------------------------------\n";
cout<<"*WJRvillage有点小...但也足够了...";
tmp_cai2=1;
Sleep(200);
}
if(x==6&&y==13||x==7&&y==13||x==7&&y==14||x==7&&y==15||x==6&&y==15){
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
cout<<"------------------------------------\n";
cout<<"*卸嘻嘻~~~嘻嘻嘻~~~";
tmp_cai2=1;
Sleep(200);
}
}
Sleep(10);
}
system("cls");
}
void caid(){//caidan
SetConsoleTitle("ssadcas");
system("mode con cols=40 lines=10");
Sleep(20);
SetConsoleTitle("dsf");
system("mode con cols=400 lines=50");
Sleep(20);
SetConsoleTitle("asdcsadsfgtre");
system("mode con cols=60 lines=70");
Sleep(20);
SetConsoleTitle("sabjsad");
system("mode con cols=30 lines=20");
Sleep(20);
SetConsoleTitle("mljk");
system("mode con cols=300 lines=90");
Sleep(20);
SetConsoleTitle("asdfrgtrhfdfgrytrfd");
system("mode con cols=200 lines=70");
Sleep(20);
SetConsoleTitle("sdfgt");
system("mode con cols=20 lines=5");
Sleep(20);
SetConsoleTitle("dfsrtytregtrefd");
system("mode con cols=200 lines=60");
Sleep(20);
SetConsoleTitle("gred");
system("mode con cols=350 lines=20");
Sleep(300);
int caidan=rand()%2;
// caidan=0;
if(caidan==1){
SetConsoleTitle("WJRshop");
system("mode con cols=50 lines=10");
mciSendString("play music/mus_temshop.mp3 repeat", 0, 0, 0);
print_cai1_1();
slowlyout("*NeyhHehHeh~~~欢迎来到WJR的小店~~~");
Sleep(1500);
system("cls");
print_cai1_3();
slowlyout("*啥???你不想买东西???");
Sleep(1500);
system("cls");
print_cai1_2();
slowlyout_2("*那就。。。");
Sleep(500);
slowlyout_red("祝 你 在 地 狱 里 燃 烧 !");
Sleep(1500);
system("cls");
print_cai1_3();
slowlyout("*哈哈哈,再见~~~");
Sleep(1500);
system("cls");
mciSendString("stop music/mus_temshop.mp3 ", 0, 0, 0);
}
else{
SetConsoleTitle("WJRvillage");
system("mode con cols=50 lines=14");
mciSendString("play music/mus_temvillage.mp3 repeat", 0, 0, 0);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
out("*奇奇怪怪的小镇,\n 墙面上写着WJRvillage");
Sleep(1500);
system("cls");
out("*小镇的门还没有打开\n 隔着栅栏,你看到一个笑脸在敲代码");
Sleep(1500);
system("cls");
out("*一段时间后,笑脸敲好代码,离开了\n 小镇的门也打开了");
Sleep(1500);
system("cls");
out("*你好奇地进入了小镇...");
Sleep(1500);
system("cls");
cai2();
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_INTENSITY | FOREGROUND_RED |FOREGROUND_GREEN | FOREGROUND_BLUE);//白色
out("*你离开了小镇...");
Sleep(1500);
system("cls");
mciSendString("stop music/mus_temvillage.mp3 ", 0, 0, 0);
}
}
2、开始制作逃离系列2主体部分