【GoC游戏】等(wait)1.0.0版本

*将下面代码复制到在线IDEhttps://top.51goc.com/ide点击运行即可


代码如下:

cpp 复制代码
bool a = true;
bool a2 = true;
bool yeswin[11] = {false,true,false};
int x ;
int y ;
int game = 1;

void win();
void game1();
void game2();
void game3();
void guanqia();
void gamemod(int a);

void shuoye()
{
    int c = 0;
    p.load().clss().cav(-1).fill(15).hide().up();
    p.moveTo(0, 0).speed(10).size(10).c(0).setAngle(0);
    for (int i = 800; i > 0; i = i - 10)
    {
        p.rgb(c, c, c);
        p.r(i, i, 16);
        c = c + 5;
    }
    p.moveTo(-400, 0);
    for (int i = 0; i < 53; i++)
    {
        p.drawH();
        p.fd(45).rt(6);
    }
    p.font(6);
    p.button(1, "开始游戏", 15, 50, 0, 0, -300, 0);
    p.button(4, "选关", 15, 50, 0, 300, 300, 0);
    p.text("等", 15, 180, 0, -5, -5);
    p.text("等", 0, 180, 0, 0, 0);
    p.font(1).text("WAIT", 0, 20, 0, 50, -90);
    p.text("作者:luo_",15,20,0,-340,-380).font(6);
    p.cav(0);
    p.moveTo(40, 110);
    p.setAngle(-45);
    p.drawH();
    p.cav(-1);

    for (;;)
    {
        if (buttonMP(4) && a2 == true)
        {
            a2 = false;
            guanqia();
        }

        bool hover = false;
        if (buttonMI(1) || buttonMI(4))
            hover = true;
        cursor(hover ? "pointer" : "default");

        if (mouseDown(-20, 0, 200) && a == true)
        {
            int cf = rand(0, 255);
            p.rgb(cf, cf, cf);
            p.text("等", 16, 180, 0, 0, 0);
            wait(0.01);
        }

        else if (buttonMP(1) && a == true)
        {
            a = false;
            p.moveTo(0, 0);
            for (int i = 0; i < 820; i = i + 10)
            {
                p.cav(-1).clsRec(i, i).rr(i, i, 0);
                p.cav(0).clsRec(i, i).rr(i, i, 0);
                wait(0.01);
            }
            x = getMX();
            y = getMY();
            gamemod(game);
        }
    }
}
void laoding()
{
    p.load().clss().cav(-1).hide().up();
    p.speed(10).setAngle(90);
    p.moveTo(-100, 0);
    for (int i = 0; i < 250; i++)
    {
        p.rgb(i, i, i);
        p.rr(4, 800, 16).fd(400 / 250.0);
    }
    p.cav(0).fill(0);
    p.moveTo(-200, 200);
    p.setAngle(90);
    for (int i = 0; i < 230; i = i + 5)
    {
        p.rgb(i, i, i);
        p.text("加载中...", 16, 100);
        p.fd(2);
    }
    p.moveTo(100, -100).r(400, 30, 8);
    p.moveTo(-96, -100);
    for (int i = 0; i < 390; i++)
    {
        p.clsRec(4, 22);
        p.fd(1);
        wait(0.01);
    }
    shuoye();
}

void game1()
{
    yeswin[1] = true;
    cursor("default");
    p.load().cls().fill(0).up().speed(10).cav(1).font(6).c(15);
    p.moveTo(0, 300).size(2);
    p.text("第一关", 15, 50);
    p.moveTo(-100, -120).text("终点", 15);
    p.moveTo(-100, -100).o(5, 15);
    p.moveTo(100, -100).setAngle(-90);
    p.show().down().speed(2);
    wait(1);
    x = getMX();
    y = getMY();
    for (int i = 0; i < 200; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.fd(1);
    }   
    win();
}

void game2()
{
    yeswin[2] = true;
    cursor("default");
    p.load().cls().fill(0).up().speed(10).cav(1).font(6).c(15);
    p.moveTo(0, 300).size(2);
    p.text("第二关", 15, 50);
    p.moveTo(-100, -120).text("终点", 15);
    p.moveTo(-100, -100).o(5, 15);
    p.moveTo(100, -100).setAngle(-90);
    p.show().down().speed(1);
    wait(1);
    x = getMX();
    y = getMY();

    for (int i = 0; i < 100; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.fd(1);
    }
    p.speed(5).moveTo(0, 100).speed(10);
    for (int i = 0; i < 360; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.rt(67);
        wait(0.01);
    }
    if (x != getMX() || y != getMY())
    {
        p.hide();
        p.cls().fill(0).text("你输了!", 15, 200);
        a = true;
        wait(2);
        shuoye();
    }
    p.speed(2).lineTo(-100, -100);
    
    win();
}

void game3()
{
    yeswin[3] = true;
    cursor("default");
    p.load().cls().fill(0).up().speed(10).cav(1).font(6).c(15);
    p.moveTo(0, 300).size(2).show();
    p.text("第三关", 15, 50);
    p.moveTo(-100, -120).text("终点", 15);
    p.moveTo(-100, -100).o(5, 15);
    p.moveTo(100, -100).setAngle(-90);
    p.speed(1).down();
    wait(1);
    x = getMX();
    y = getMY();

    for (int i = 0; i < 100; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.fd(1);
    }
    p.up();
    for (int i = 0; i < 50; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.fd(1);
    }
    wait(1);
    p.speed(5).down();
    p.setAngle(0).moveTo(-100, 250);
    for (int i = 0 ; i < 4; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        if (i % 2 == 0)
            p.fd(100);
        else
            p.fd(200);
        p.rt(90);
    }
    p.moveTo(0, 300);
    wait(2);
    p.rr(200, 100, 15).hide().speed(3).up();
    for (int i = 0; i < 400; i++)
    {
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.bk(1);
    }
    double alpha = 0;
    p.lt(90).down().alp(alpha).speed(1);
    for (int i = 0; i < 100; i++)
    {
        if (i == 50)
            p.show();
        if (x != getMX() || y != getMY())
        {
            p.hide();
            p.cls().fill(0).text("你输了!", 15, 200);
            a = true;
            wait(2);
            shuoye();
        }
        p.fd(1).alp(alpha);
        alpha = alpha + 0.01;
    }
    win();
}

void win()
{
    p.load().cls().fill(0).hide().font(6).speed(10).size(6).c(0).up();
    p.text("通关!", 15, 100, 0, 0, 200);
    p.button(2, "返回", 15, 50, 0, -200, -100, 0);
    p.button(3, "下一关", 15, 50, 0, 200, -100, 0);
    p.setAngle(-45).moveTo(-140, -50).drawH();
    p.moveTo(280, -50).drawH();

    for (;;)
    {
        bool hover = false;
        if (buttonMI(2) || buttonMI(3))
            hover = true;
        cursor(hover ? "pointer" : "default");

        if (buttonMP(2))
        {
            a = true;
            a2 = true;
            shuoye();
        }
        if (buttonMP(3))
        {
            game++;
            if (game > 10)
                game = 10;
            gamemod(game);
        }
    }
}

void guanqia()
{
    p.load().cls().cav(1).fill(0).hide().up();
    p.speed(10).font(6);
    p.text("选择关卡", 15, 60, 0, 0, 220);

    int posX[] = {-320, -160, 0, 160, 320};
    int posY1 = 50;
    int posY2 = -120;

    for (int i = 1; i <= 10; i++)
    {
        int px, py;
        if (i <= 5)
        {
            px = posX[i - 1];
            py = posY1;
        }
        else
        {
            px = posX[i - 6];
            py = posY2;
        }

        if (yeswin[i] == true)
        {
            p.button(10 + i, d2s(i) + "关", 1, 45, 0, px, py, 0);
        }
        else
        {
            p.moveTo(px, py);
            p.c(8);
            p.text(d2s(i) + "关", 8, 45);
        }
    }

    p.button(99, "返回首页", 15, 50, 0, -250, 300, 0);

    for (;;)
    {
        bool hover = false;
        for (int i = 1; i <= 10; i++)
        {
            if (yeswin[i])
            {
                if (buttonMI(10 + i))
                    hover = true;
                if (buttonMP(10 + i))
                {
                    game = i;
                    a = true;
                    a2 = true;
                    gamemod(game);
                }
            }
        }

        if (buttonMI(99))
            hover = true;
        cursor(hover ? "pointer" : "default");

        if (buttonMP(99))
        {
            a = true;
            a2 = true;
            shuoye();
        }
    }
}

void gamemod(int a)
{
    if (a == 1)
        game1();
    if (a == 2)
        game2();
    if (a == 3)
        game3();
    /*        */
}

int main()
{
    p.save();
    laoding();
    return 0;
}

预览:

(目前只做了3关)





游戏规则:

顾名思义,等,鼠标动了就输了


如有BUG请指出!

相关推荐
驱动小百科16 小时前
国产3A游戏《影之刃零》正式发售:售价及电脑配置要求介绍
游戏·影之刃零·影之刃零配置要求·影之刃零下载·影之刃零售价
信奥卷王18 小时前
[GESP202312 六级] 闯关游戏
游戏
德迅云安全-上官20 小时前
德迅游戏盾:面向 TCP 业务的分布式云安全防护方案
分布式·tcp/ip·游戏
科技那些事儿21 小时前
旗舰游戏本 CPU 对决:锐龙 9 9955HX 对比酷睿 Ultra 9 275HX
游戏·智能手机·智能电视
njsgcs1 天前
老滚5 文本替换中文简体 仓库加经验glm5.3f
游戏
I Am a robert girl2 天前
从 GameHorizon 拆解多时间尺度游戏评测:数据管线、离线基准与在线回放的三层设计
数据库·游戏·多时间尺度·数据管线·游戏评测·离线基准·在线回放
大囚长2 天前
AI意图预测与游戏全球同服对战的超光速零延迟探究
人工智能·游戏
qq3621967052 天前
OBB 数据包是什么?大型游戏 APK 装完闪退的元凶(2026)
游戏
xiaolang_8616_wjl2 天前
c++游戏_宝可梦大世界(源代码)
开发语言·c++·游戏
凯基迪科技3 天前
Unity游戏加密锁逆向方案、选型与攻防分析
游戏·unity·游戏引擎