饮料小铺(v0.01 _test)
2026-05-15 23:55:04
发布于:上海
我也是做上游戏了,不过很多都是糊弄的,只弄了一些外观,敬请谅解
#include <windows.h>
#include <conio.h>
#include <bits/stdc++.h>
using namespace std;
//-------------------------------
unsigned long long money = 0;
string fruit_list[11] = {"苹果","香蕉","猕猴桃","蓝莓","草莓","菠萝","桃子","梨","西瓜","哈密瓜","葡萄"};
string size_list[6] = {"超级杯","特大杯","大杯","中杯","小杯","特小杯"};
string sugar_list[6] = {"0%","50%","80%","100%","120%","150%"};
string other_list[2] = {"无","珍珠"};
//--------------------------------
void game();
void tout();
void exit_game(int code = 0);
void ready_game();
void unfinish_game();
void newplayer();
void start();
void game();
void tout(string s = "",DWORD t = 70){
for(int i = 0;i < s.size();i++){
cout << s[i];
Sleep(t);
}
}
void exit_game(int code){
//system("cls");
tout("下次再见!");
ExitProcess(code);
}
void ready_game(){
tout("WELCOME!\n");
tout("按下s键来开始游戏!\n");
tout("按下ESC键来关闭游戏!");
while(1){
char ch = getch();
//预备:新手教程
if(ch == 's') game();
else if(ch == '\033') exit_game();
Sleep(20);
}
}
//----------------------------------
void unfinish_game(){
tout("\n0v0 还没做完哦\n");
tout("邮箱:xuhaoyun2024@163.com\n");
tout("(我都好几年没看过邮箱了……)");
}
void newplayer(){
tout("是否需要新手教程(y 键)\n");
char ch = getch();
if(ch == 'y'){
unfinish_game();
}
system("cls");
}
void start(){
system("color 1D");
tout("你好!\n",0);
tout("欢迎来到饮料小铺!(v0.01 _test)\n",0);
tout("在这里,你将会制作各种各样的饮料。\n",0);
tout("开始游戏吧!\n",0);
system("pause");
system("cls");
}
void game(){
while(true){
Sleep(200);
system("cls");
cout << "[ESC] -> 退出" << endl;
cout << "[G] -> 完成" << endl;
if(kbhit()){
char ch = getch();
if(ch == '\033'){
exit_game();
}else if(ch == 'g'){
money++;
}
}
cout << "MONEY:" << money << endl;
}
}
//---------------------------
int main(){
start();
ready_game();
return 0;
}
全部评论 2
谢谢点赞!!!
昨天 来自 上海
0欢迎!!!
昨天 来自 上海
0














有帮助,赞一个