【游戏开发】天龙八部demo

 摘要:

沐春风,惹一身红尘;望秋月,化半缕轻烟。顾盼间乾坤倒转,一霎时沧海桑田。方晓,弹指红颜老,刹那芳华逝。

                                                                                                                                              ——金庸《天龙八部》

//stdafx.h

#ifndef STDAFX_H
#define STDAFX_H

//输入输出函数包含的头文件
#include <stdio.h>

//system函数包含的头文件
#include <stdlib.h>

//设置光标位置包含的头文件
#include <windows.h>

//时间函数包含的头文件
#include <time.h>

//播放音乐函数的头文件
#pragma comment(lib,"Winmm.lib")

//播放音乐
void play_music();

//设置输入,输出的位置,也就是当前光标位置
void setxy(int x, int y);

//欢迎界面,进入游戏提示:欢迎来到《天龙八部》游戏世界
int welcome();

//选择服务器
int select_server();

#endif
//setxy.cpp

#include "stdafx.h"

void setxy(int x, int y)
{
	COORD coord = { x, y };
	SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
//welcome.cpp

#include "stdafx.h"

int welcome()
{
	//设置窗口标题
	SetConsoleTitle(L"《新天龙八部》1.0");

	//设置窗口大小100×50
	system("mode con cols=100 lines=50");

	//设置白底红字
	system("color f4");

	//设置光标到窗口中央
	setxy(25, 20);

	//输出欢迎语居中显示
	printf("欢迎来到《天龙八部》游戏世界!");

	//设置系统时间
	time_t t;
	struct tm * lt;
	time(&t);
	lt = localtim
  • 3
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值