表白神器🤣

2019年1月28日深夜,跟一个女孩摊牌了,告诉她我喜欢她很久了。当时说好三个月给我结果。

然后在第十四天,那天大年初六,是她生日。我给她过的,就我俩。那天上午去车站接她,帮她拿行李的时候,我的帽子蹭到了泥,她算是关切地拿纸巾给我擦了擦,一切都还算美好。

送她到家,中午在金拱门简单地吃了。又带她去看了电影(疯狂的外星人),整个过程算是有说有笑吧。出来过后讨论了电影中的笑点,我说很尬,她表示同意。现在想想自己真尬!

五点多去蛋糕店领了蛋糕,我很没脑子地把她的生肖弄错了。但是她一点反应都没有,这大概叫无所谓吧。那是她24岁生日,当服务员拿出一个2和一个4的蜡烛时,她孩子气地说,“怎么是24?我明明才18!🤣”。后来人家服务员给她换的18。

后来去吃晚餐,我把重头戏都放在晚餐了。我拿出手机,连上蓝牙耳机,把耳机的一头给她,让她听,然后让她点开了事先安装好的APP(就是下面这段代码,稍作修改,就可以用C4droid打包成apk)。

只见孤男寡女牵手而坐,望着天空,身边一群蝴蝶围绕。耳机中传来张傲寒的《我们》(我想去,有你的地方,带给你春天的希望)。星空中是女孩的两张照片,随风左右微微飘摇。当她点击屏幕后,那群蝴蝶缓缓向视野外飞去,好像所有的蝴蝶都不愿打扰二人。事实上,蝴蝶们只是藏了起来,重新组成了两颗近而不腻的心,又缓缓地飞入画面。用他们的方式祝福二人可以永远在一起。

美,太美了,美不胜收!
要登飞机了,先这样吧。
哦对了,最后我失败了。

#include "SDL_image.h"
#include "SDL_mixer.h"
#include <iostream>

#define COUNT 22
#define DOWN 80
SDL_Rect rectText, rectFirst[COUNT], rectLeft[COUNT], rectRight[COUNT], walks[4][4];
SDL_Surface* helloSur = NULL;
SDL_Surface* backSur = NULL;
SDL_Window* mainWin = NULL;
SDL_Renderer* helloRend = NULL;
SDL_Texture* helloTex = NULL;
SDL_Texture* backTex = NULL;
Mix_Music *mix_music = NULL;
int xWin, yWin;

int Sound_Init()
{
    const int    TMP_FREQ = MIX_DEFAULT_FREQUENCY;
    const Uint16 TMP_FORMAT = MIX_DEFAULT_FORMAT;
    const int    TMP_CHAN = 2;
    const int    TMP_CHUNK_SIZE = 512;
    return Mix_OpenAudio(TMP_FREQ, TMP_FORMAT, TMP_CHAN, TMP_CHUNK_SIZE);
}

void setRectLeft()
{
    rectLeft[0].x = 0 * (helloSur->w / 4) + 2 * xWin + 10;
    rectLeft[0].y = 2 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[1].x = 0 * (helloSur->w / 4) + 2 * xWin + 10;
    rectLeft[1].y = 3 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[2].x = 1 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[2].y = 1 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[3].x = 1 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[3].y = 4 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[4].x = 2 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[4].y = 0 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[5].x = 2 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[5].y = 5 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[6].x = 3 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[6].y = 0 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[7].x = 3 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[7].y = 6 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[8].x = 4 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[8].y = 1 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[9].x = 4 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[9].y = 7 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[10].x = 5 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[10].y = 2 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[11].x = 5 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[11].y = 8 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[12].x = 6 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[12].y = 1 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[13].x = 6 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[13].y = 7 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[14].x = 7 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[14].y = 0 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[15].x = 7 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[15].y = 6 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[16].x = 8 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[16].y = 0 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[17].x = 8 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[17].y = 5 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[18].x = 9 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[18].y = 1 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[19].x = 9 * (helloSur->w / 4) + 2 * xWin;
    rectLeft[19].y = 4 * (helloSur->h / 5) + yWin / 2 + DOWN;

    rectLeft[20].x = 10 * (helloSur->w / 4) + 2 * xWin - 10;
    rectLeft[20].y = 2 * (helloSur->h / 5) + yWin / 2 + DOWN;
    rectLeft[21].x = 10 * (helloSur->w / 4) + 2 * xWin - 10;
    rectLeft[21].y = 3 * (helloSur->h / 5) + yWin / 2 + DOWN;
}

int main(int argc, char* args[])
{
    SDL_Init(SDL_INIT_EVERYTHING);
    Sound_Init();
    mainWin = SDL_CreateWindow("My Game", 10, 50, 540, 960, 0/*SDL_WINDOW_FULLSCREEN*/);
    SDL_GetWindowSize(mainWin, &xWin, &yWin);
    helloSur = IMG_Load("love.png");
    backSur = IMG_Load("back.jpg");
    helloRend = SDL_CreateRenderer(mainWin, -1, SDL_WINDOW_FULLSCREEN);
    helloTex = SDL_CreateTextureFromSurface(helloRend, helloSur);
    backTex = SDL_CreateTextureFromSurface(helloRend, backSur);
    
    mix_music = Mix_LoadMUS("relove.mp3");
    Mix_PlayMusic(mix_music, -1);

    rectText = { 0, yWin / 4, xWin, 20 };

    for (int i = 0; i < COUNT; i++)
    {
        rectFirst[i].x = rand() % (xWin - helloSur->w / 4);
        rectFirst[i].y = (rand() % yWin / 2) + yWin / 2;
        rectFirst[i].h = helloSur->h / 4;
        rectFirst[i].w = helloSur->w / 4;
    }

    setRectLeft();
    for (int i = 0; i < COUNT; i++)
    {
        rectLeft[i].h = helloSur->h / 4;
        rectLeft[i].w = helloSur->w / 4;
    }
    
    for (int i = 0; i < COUNT; i++)
    {
        rectRight[i] = rectLeft[i];
        rectRight[i].x = rectLeft[i].x + 300;
        rectRight[i].y = rectLeft[i].y - 100;
    }

    for (int i = 0; i < 4; i++)
    {
        for (int j = 0; j < 4; j++)
        {
            walks[i][j].x = i * helloSur->w / 4;
            walks[i][j].y = j * helloSur->h / 4;
            walks[i][j].w = helloSur->w / 4;
            walks[i][j].h = helloSur->h / 4;
        }
    }

    int a = 0;
    int b = 1;
    bool boGo = false;
    bool done = false;
    SDL_Event event;
    Uint32 start = SDL_GetTicks();//开始时间

    while (!done)
    {
        while (SDL_PollEvent(&event))
        {
            if (event.type == SDL_QUIT)
            {
                done = true;
            }
            if (event.type == SDL_MOUSEBUTTONDOWN)
            {
                if (event.button.button == SDL_BUTTON_LEFT)
                {
                    boGo = true;
                }
            }
        }
        if ((SDL_GetTicks() - start) % 100 == 0) //每100秒执行一次
        {
            SDL_RenderClear(helloRend);
            SDL_RenderCopy(helloRend, backTex, NULL, NULL);
            if (boGo)
            {
                for (int i = 0; i < COUNT; i++)
                {
                    if (rectLeft[0].x > xWin / 5)
                    {
                        rectLeft[i].x -= 5;
                        rectRight[i].x -= 5;
                        rectFirst[i].x += 5;
                    }
                    SDL_RenderCopy(helloRend, helloTex, &walks[a][b], &rectLeft[i]);
                    SDL_RenderCopy(helloRend, helloTex, &walks[a][b], &rectRight[i]);
                    SDL_RenderCopyEx(helloRend, helloTex, &walks[a][b], &rectFirst[i], 0.0, NULL, SDL_FLIP_HORIZONTAL);
                }
                a = (a + 1) % 4;
            }
            else
            {
                for (int i = 0; i < COUNT; i++)
                {
                    SDL_RenderCopyEx(helloRend, helloTex, &walks[a][b], &rectFirst[i], 0.0, NULL, SDL_FLIP_HORIZONTAL);
                }
                a = (a + 1) % 4;
            }
            SDL_RenderPresent(helloRend);
        }
    }
    SDL_DestroyWindow(mainWin);
    SDL_Quit();

    return 0;
}
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容