#include <stdio.h>
#include <easyx.h>
#include <stdlib.h>
#include <time.h>
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
IMAGE img_bk[2];
void loadImg()
{
loadimage(img_bk + 0, L".//images//welcome.jpg",getwidth(),getheight());
loadimage(img_bk + 1, L".//images//bk.jpg", getwidth(), getheight());
}
void welcome()
{
mciSendString(L"open .//images//浪漫空气.mp3", NULL, 0, NULL);
mciSendString(L"play .//images//浪漫空气.mp3", NULL, 0, NULL);
srand(time_t (NULL));
setbkmode(TRANSPARENT);
settextstyle(40, 0, L"宋体");
while (true)
{
putimage(0, 0, img_bk + 0);
settextcolor(RGB(rand() % 256, rand() % 256, rand() % 256));
outtextxy(450, 20, L"灵梦");
outtextxy(200, 100, L"我喜欢你灵梦");
outtextxy(200, 150, L"在我初入幻想乡");
outtextxy(200, 200, L"那时我身边一个人都没有");
outtextxy(200, 250, L"映入在我眼前的是一片黑暗");
outtextxy(200, 300, L"那时的我又饿又渴感觉自己马上就要虚无了");
outtextxy(200, 350, L"就在我快闭上眼时突然听到一个少女的声音");
outtextxy(200, 400, L"往前走8公里你会看到一个神庙然后往赛钱箱塞钱");
for (int i = 0; i < 10; i++)
{
settextcolor(RGB(rand() % 256, rand() % 256, rand() % 256));
outtextxy(rand()%getwidth(), rand()%getheight(), L"♥ ❤");
}
Sleep(500);
}
}
int main()
{
initgraph(1200, 800, EX_SHOWCONSOLE);
setbkcolor(WHITE);
cleardevice();
loadImg();
welcome();
getchar();
return 0;
}